hi i created this page for displaying my products that it works with select query from data base but after all try i could show the 3 of them in pages but all i want is displaying 6 of them in different tables after each other
please help me with this problem ???
<?php include "db.php";
// row for quantities
$qtyRow = '<tr>';
// row for prices
$priceRow = '<tr>';
$nn=3;
$s=mysql_query("select * from test1");
$c=mysql_num_rows($s);
if($c%$nn==0)
{
$cc=$c/$nn;
}
else
{
$cc=$c/$nn+1;
}
$ss=@$_REQUEST['ss'];
if($ss=="")
{ $sql=mysql_query("select * from test1 order by id desc limit 3");
while($r=mysql_fetch_array($sql))
{
$id=$r['id']; $name=$r['name'];
$qtyRow .= "<td>$id</td>";
$priceRow .= "<td>$name</td>";
}
// end of the rows
$qtyRow .= '</tr>';
$priceRow .= '</tr>';
// echo the table
echo "<table border=\"1\" align=\"center\">";
echo $qtyRow;
echo $priceRow;
echo "</table>";
?>
<?php
}
else
{
$sql=mysql_query("select * from test1 order by id desc limit $ss,3 ");
while($r=mysql_fetch_array($sql))
{
$id=$r['id']; $name=$r['name'];
$qtyRow .= "<td>$id</td>";
$priceRow .= "<td>$name</td>";
}
// end of the rows
$qtyRow .= '</tr>';
$priceRow .= '</tr>';
// echo the table
echo "<table border=\"1\" align=\"center\">";
echo $qtyRow;
echo $priceRow;
echo "</table>"; ?>
<?php } ?>
</p>
<?php
$j=0;
echo"page : ";
for($i=1;$i<=$cc;$i++)
{
echo"<a href=\"select.php?ss=$j\">$i</a>";
echo"|";
$j=$j+$nn;
}
?>
you suppose that this is my table that showed 3 of them in one table :
10 9 8
k a s
i wanna change it to this kind of form :
10 9 8
k a s
7 6 5
q z w
and then i m gonna change my pages with this form
page : 1|2|3|4|