Well at least I think my troubles are with the get variable. I know my code is amateur I am very new to PHP and trying to learn as much as I can.
So I am trying to create a photo gallery any having trouble with getting my get variable to do its job.
I have 2 pages:
photo.php - which I believe works just fine.
$con = mysql_connect("...","...","...");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("...", $con);
$result = mysql_query("SELECT * FROM photo_albums ORDER BY uptime DESC");
while($row = mysql_fetch_array($result))
{
echo '<div class="photoThumb">';
echo '<a href="viewAlbum.php?aid='.$row['aid'].'"><img src="' . $row['filepath'];
echo $row['filename'] . '"';
echo 'border="0" /></a>';
echo '<br/>';
echo '<span class="thumbText"><a href="viewAlbum.php?aid='.$row['aid'].'">' . $row['stitle'];
echo '</a><br/>';
echo $row['photog'];
echo '</span>';
echo "</div>";
}
mysql_close($con);
Then viewAlbum.php - this is whats not working. I have tried many different ways of code and now I am just lost.
$con = mysql_connect("...","...","...");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("...", $con);
$aid = $_GET['aid'];
$select = ("SELECT * FROM 'pictures' WHERE 'aid' = '$aid'");
$result = mysql_query($select) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
extract ($row);
echo '<div class="photoThumb">';
echo '<a href="';
echo $row['filepath'];
echo $row['filename'];
echo '"><img src="';
echo $row['filepath'];
echo $row['filename'];
echo '" rel="lightbox[' .$row['aid'];
echo ']" border="0" width="100px" /></a><br/>';
echo "</div>";
}
mysql_close($con);
Can anyone help me get this sorted out??
Thanks,
Brian