Jump to content


Photo

Image Slideshow


  • Please log in to reply
1 reply to this topic

#1 roystonvon

roystonvon
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 11 July 2006 - 11:18 AM

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 

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 11 July 2006 - 04:52 PM

Well, you'll probably have to pass the uid of the "next" and "previous" images via hidden fields in your HTML.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users