Can anyone help me resolve this issue?
It will open the page with the next 10 records, but not display a link for the next 10 on the 3rd+ pages.
<?
isset($_GET['start']) ? $start = $_GET['start'] : $start = 0;
$dbuser = "user";
$dbserver = "localhost";
$dbpass = "pass";
$dbname = "name";
mysql_connect($dbserver, $dbuser, $dbpass)
or die ("UNABLE TO CONNECT TO DATABASE");
mysql_select_db($dbname)
or die ("UNABLE TO SELECT DATABASE");
$sql = "SELECT * FROM inventory ORDER BY ref ASC LIMIT $start,10";
$result = mysql_query($sql) or die(mysql_error());
if ($myrowsel = mysql_fetch_array($result)) {
do
{
$id=$myrowsel['id'];
$ref=$myrowsel['ref'];
$year=$myrowsel['year'];
$make=$myrowsel['make'];
$model=$myrowsel['model'];
$price=$myrowsel['price'];
switch ($shade)
{
case 'row_lite':
$shade = 'row_drk';
break;
case 'row_drk':
$shade = 'row_lite';
break;
default:
$shade = 'row_lite';
break;
}
echo " <tr>
<td valign=top class=$shade>
<table width=100% cellspacing=0 cellpadding=3>
<tr>
<td width=75 align=center valign=middle><img src=list/$ref.jpg alt='Image not available' width=75 height=56></td>
<td width=100 nowrap class=reg>Ref# $ref</td>
<td width=250 nowrap class=reg>$year $make $model</td>
<td width=70 nowrap class=reg>$$price</td>
<td width=100%> </td>
</tr>
</table>
</td>
</tr>
";
}
while ($myrowsel = mysql_fetch_array($result));
}
?>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width=100% valign=top colspan=2>
<table width=100% cellspacing=0 cellpadding=3>
<tr>
<td width=10> </td>
<td width=100%>
<?
$next = +10;
if ($start < 10) {
echo "<a class=lnk href=list_main3.php?start=$next>Next page »</a>";
}
?>
Thanks,
xsfssg
P.S. The '$$price' above is actually & # 3 6 ; $price without spaces