roystonvon Posted July 11, 2006 Share Posted July 11, 2006 Hi There,I am new to php but would like to use it to create an image slideshow using a mysql db. What i would like to do is to retrieve one record at a time and allow the user to scroll through the results using buttons. can someone point me in the right direction?This is my code so far:"><!--pinclude 'db.inc';$skilltype = $_POST["skillset"]; $query = "SELECT id, shortName, mimeName FROM rugbyimages where shortName like '$skilltype'";if (!($connection = @ mysql_pconnect($hostName, $username, $password))) showerror();if (!mysql_select_db("r36048_images", $connection)) showerror(); if (!($result = @ mysql_query ($query, $connection))) showerror();--><h1><!--p echo $skilltype;--></h1><!--p $num=mysql_numrows($result);echo $num;$i=0; if ($row = @ mysql_fetch_array($result)) {--><table><colgroup><col align="right"><!--p do {--></colgroup><tbody><tr><td><!--p echo "<img src="view.php?file={$row["id"]-->";?></td></tr><!--p} while ($row = @ mysql_fetch_array($result));--></tbody></table><!--p} // if mysql_fetch_array()elseecho "<h3>There are no images to display</h3>n";--></body>Thanks,Roystonvon Quote Link to comment Share on other sites More sharing options...
fenway Posted July 11, 2006 Share Posted July 11, 2006 Well, you'll probably have to pass the uid of the "next" and "previous" images via hidden fields in your HTML. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.