Hello,
I was wondering if someone could point me in the right direction about the following. I'm showing 4 pictures at a time on a webpage based on a php/mysql-recordset of about 50 records. I could add a next button to move through the pictures, but I'd like to make it move automatically in such a way that every second 1 new picture is shown at the left side and 1 picture is removed at the right side. When the end of the recordset is reached, it starts with #1 again. So basically a slide show with 4 pictures that moves 1 picture every second.
So far code is :
<?php require_once('../Connections/test.php'); ?>
<?php
$maxRows_Recordset1 = 4;
$pageNum_Recordset1 = 0;
if (isset($HTTP_GET_VARS['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $HTTP_GET_VARS['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_test, $test);
$query_Recordset1 = "SELECT * FROM producten where nieuw='1'";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $test) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($HTTP_GET_VARS['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $HTTP_GET_VARS['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<table width="549" height="100" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><?php do { ?>
<img src="../img/thmbnls/<?php echo $row_Recordset1['prodid']; ?>.jpg" alt="<?php echo $row_Recordset1['naam_nl']; ?>" title="<?php echo $row_Recordset1['naam_nl']; ?>" width="96" height="96">
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</td>
</tr>
</table>
Cheers,
yousaf FAYYAZ.