MySQL Image Gallery
Posted: Wed Oct 21, 2009 1:20 pm
I am trying to great a MySQL image gallery. I am currently working on getting the thumb nails to show up then i want to work on how to link it to a new page.. So far the code that I am suing is not working, I just want to thumbnails to show up with the gallery title and photographer.
Any suggestions?
Thanks,
Brian
Code: Select all
<?php
$con = mysql_connect("host","dbname","pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("dbnamer", $con);
$result = mysql_query("SELECT * FROM photo_albums");
echo '<div class="photoThumb">';
while($row = mysql_fetch_array($result))
{
//echo "<tr>";
echo '<img src="' . $row['filepath'] . . $row['filename'] . '"';
echo 'border="0" />"';
echo '<br/>';
echo '<span class="thumbText">' . $row['stitle'] . \n . $row['photog'] . '</span>';
}
echo "</div>";
mysql_close($con);
?>
Thanks,
Brian