hi all
i m having trouble getting result output of all rows in my order table.
if the order table has 5 rows then i get to print 4 rows. If the order table has 3 rows then i get to print 2 rows.
everytime one row gets missed i dont know where.
But if i echo the number of result.
echo mysql_num_rows($result_p); this gives corect output
then the number is corect. but if i echo the data in the result then one row gets miss.
I never had this trouble facing.
This is my query code
<?php
$qry_p="select * from order_detail_table";
$result_p=mysql_query($qry_p);
$row_p=mysql_fetch_array($result_p);
echo mysql_num_rows($result_p);
echo "<br>"; //this is giving me corect result.
while($row_p=mysql_fetch_array($result_p))
{
$product_name=$row_p['product_name'];
$quantity=$row_p['quantity'];
$shipping=$row_p['shipping'];
$price=$row_p['price'];
$total_cost=$row_p['total_cost'];
echo $product_name.",".$quantity.",".$shipping.",".$price."<br>";
}
?>
Here is the result
6 (this is number of rows)
but number of rows printed with data are 5
HTC Touch Diamond,1,20.00,550.00
LG Viewty,1,20.00,850.00
LG Viewty,1,20.00,850.00
HTC Touch Diamond,1,20.00,550.00
Nokia N95,1,20.00,575.00
vineet