Jump to content

Archived

This topic is now archived and is closed to further replies.

roystonvon

Image Slideshow

Recommended Posts

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:

"><!--p

include '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()
else
echo "<h3>There are no images to display</h3>n";
-->
</body>


Thanks,

Roystonvon 

Share this post


Link to post
Share on other sites
Well, you'll probably have to pass the uid of the "next" and "previous" images via hidden fields in your HTML.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.