Actually, there are a couple more things. I want to display the text for each image(from the name column of image_thumbs) under each thumbnail in the galley.
This is the code i have for this, but it is not displaying any text.
[php]
Gallery
body{
background-color:yellow;
}
#thumbs{
width: 1300px;
position: relative;
top: 40px;
left: 0px;
}
#here{
position: relative;
left:100px;
background-color:white;
}
div.thumb{
float: left;
padding: 10px 5px 10px 5px;
margin-bottom: 60px;
}
img.thumbnail{
border-style: solid;
border-width: 2px;
border-color: red;
background-color: black;
padding: 15px;
}
<?php
include 'connect.php';
?>
Here are all the images in the gallery:
<?php
$q = "SELECT a.imagepath AS thumbpath, b.imagepath AS imagepath
FROM image_thumbs AS a
JOIN table_images AS b
USING(id)";
$t = "SELECT name FROM image_thumbs";
$row2 = mysql_query($t);
if($r = mysql_query($q))
{
echo ‘
’;
while($row=mysql_fetch_array($r))
{
echo ‘
’,
“<a href=’{$row[‘imagepath’]}’><img class=‘thumbnail’ src=’{$row[‘thumbpath’]}’ alt=‘Image’ />”,
“
”,
“{$row2[‘name’]}”,
‘
’;
}
echo '</div>';
}
else
{
echo mysql_error();
}
?>
[/php]
And I also need the images to display so that they are in reverse order, the tables add the data to the end but I want the gallery to display the images so that the last one uploaded is the first one in the gallery. How would I go about doing this?