Jump to content

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 
Link to comment
https://forums.phpfreaks.com/topic/14283-image-slideshow/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.