I am wanting to add buttons that will allow the user to cycle through images i have stored in my database. A next and previous button.
I have found this post but do not understand it.
best way for next/previous buttons for entries in yii
Here is a link to the page.
http://www.colourmyiphone.co.uk/phone.php
Function code, db_connect has the database stored and is working. The function is being called from the phone.php page.
<?php
include 'db_connect.php';
function show_body(){
$product = mysql_query("SELECT COUNT(id), colour, link FROM phone_body") or die(mysql_error());
$row = mysql_fetch_array($product);
$count = $row['COUNT(id)'];
$colour = $row['colour'];
$link = $row['link'];
//echo "$count";
echo "<img class=\"phone\" img src=$link> </br>";
echo "<form action=\"\" method=\"POST\">
<input type=\"submit\" name=\"next\" class=\"next\" value=\"Next\">
</form>";
echo "<form action=\"\" method=\"POST\">
<input type=\"submit\" name=\"previous\" class=\"previous\" value=\"Previous\">
</form>";
}
?>
Thanks for the help :)