Help with split page
| From: | Lawrence | Date: | Sun, 23 Nov 2003 14:52:01 +0000 |
| Subject: | Help with split page | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-22168@lists.php.net to get a copy of this message | ||
I have 50 products , I want to display 10 products per page , if I use LIMIT
, I will make 5 links , but I want the code will make 5 links automatically
for me , I do not know how to do , anyone can help me , thank you
<?
mysql_connect('localhost', '', '');
mysql_select_db("shoppingcart");
$result= mysql_query("select * from produclist where manhom=$xp") ;
$cnt = mysql_num_rows($result);
for ($i = 0 ; $i <= $cnt ; $i++ )
{
$row = mysql_fetch_array($result) ;
echo "<tr><td align=center><img
src=".$row["image"]."></td>
<td align=center><a
href=details.php?t=".($i).">".$row["name"]."</a></td>
<td
align=center>".$row['price']."</td></tr>" ;
}
?>