Hi
I've made a site with a couple of gallerys, i've got a page with thumbnails and a basic link to a page that just calls one record from MySQL and then displays the picture from that record, I want to put links to the next and previous pic in that gallery, thing is the table with the pictures records isn't in order of gallery....um i've confused myself now.
Table
id filename gallery
1 pic.jpg 1
2 pic.jpg 2
3 pic.jpg 1
Page for picture
<?php
$result = mysql_query("SELECT * FROM files WHERE f_id = $fid");
if ($row = mysql_fetch_array($result)){
?>
<img src="<?php printf($row["f_file"]); ?>" alt="<?php echo $row["f_name"]; ?>" width="400">
<?php
}
mysql_free_result($result);
?>
If someone knows an easy way to do this i would love to know.
Matt
I've made a site with a couple of gallerys, i've got a page with thumbnails and a basic link to a page that just calls one record from MySQL and then displays the picture from that record, I want to put links to the next and previous pic in that gallery, thing is the table with the pictures records isn't in order of gallery....um i've confused myself now.
Table
id filename gallery
1 pic.jpg 1
2 pic.jpg 2
3 pic.jpg 1
Page for picture
<?php
$result = mysql_query("SELECT * FROM files WHERE f_id = $fid");
if ($row = mysql_fetch_array($result)){
?>
<img src="<?php printf($row["f_file"]); ?>" alt="<?php echo $row["f_name"]; ?>" width="400">
<?php
}
mysql_free_result($result);
?>
If someone knows an easy way to do this i would love to know.
Matt