im trying to make a simple image gallery. I was the user to click on a link that brings up a new window that shows the first image i have stored in the database. under the picture are 2 navigational links, one shows the next image in the database and one shows the previous image stored in the database. i have been trying to write the code but am a bit stuck. what the code i have is doing is showing the first image, then when i click the next button it opens the other php file and shows the same picture in the window with no links. if anyone could help me i would greatly appreciate it.
this is the php page that shows the nav buttons and image.
<?php
print "<img src=\"test3.php?id=$id\">";
php?>
<?php
$conn = mysql_connect("server", "user", "pass") OR DIE (mysql_error());
@mysql_select_db ("db", $conn) OR DIE (mysql_error());
$sql="SELECT * FROM image";
$result = mysql_query($sql, $conn);
if (mysql_num_rows ($result)>0) {
$row = mysql_fetch_array($result);
$forward = "<a href=\"test3.php?id=".>>."\">".$row["image_name"]."</a> ";
}
print $forward;
?>
this next page is the script which will display the image in a table on the first page.
<?php
$conn = mysql_connect("server", "username", "pass") OR DIE (mysql_error());
@mysql_select_db ("db", $conn) OR DIE (mysql_error());
$sql="SELECT * FROM image WHERE image_id=".$GET["id"];
$result = mysql_query($sql, $conn);
if (mysql_num_rows ($result)>0)
{
$row = @mysql_fetch_array($result);
$image_type = $row["image_type"];
$image = $row["image"];
$image_id=$row["image_id"];
Header("Content-type: $image_type");
print $image;
}
elseif (
?>
please if anyone can help me figure this out, i have been trying to learn to do this for quite some time. thanks.