How can I alter this code so that It only displays one image at a time, with a next and previous button in order to browse through the images.
I used the code from this website
$sql = "select * from people";
$result = mysql_query($sql) or die ("Could not access DB: " . mysql_error());
while ($row = mysql_fetch_assoc($result))
{
echo "<div class=\"picture\">";
echo "<p>";
// Note that we are building our src string using the filename from the database
echo "<img src=\"images/" . $row['filename'] . "\" alt=\"\" /><br />";
echo $row['fname'] . " " . $row['lname'] . "<br />";
echo "</p>";
echo "</div>";
If no one is willing to help, can they point me in the direction of a tutorial or a website that may have the answers. I am new to php so all help is much appreciated.
Here is a basic implementation, do not forget about negative/maximum verifications and mysql injection !