problem using php and javascript for a photogallery.
Posted: Tue Aug 28, 2007 9:14 am
I'm trying to make a photo gallery with thumbnails and when the3y are clicked the full size picture is shown.
here is my code
I get the thumbnails but can get the onClick to work.
here is my code
Code: Select all
<?php
$con = mysql_connect("localhost","******","*****");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("model", $con);
$result = mysql_query("SELECT * FROM fashion");
while($row = mysql_fetch_array($result))
{
echo "<a onClick='document.getElementById('main').src=". $row[picname] . ";><img class='t_nail' src=". $row[picname] . " alt='thumbnail' /></a>";
}
mysql_close($con);
?>