Hi there,
I am trying to fetch array form database and its showing data but after that it starts flagging up with error and die.
Please let me know if I mistook somewhere in code.
While Loop is working but It dies after showing last row.
Please help.
Code is here:
$sql = "Select * from tbl_partymamber where pt_rel = $rel";
$result = mysql_query($sql);
$tot_record=mysql_num_rows($result)or die('Cannot delete product image 1. ' . mysql_error());
if($tot_record>0)
{
$sno_22 = 0;
while($row=mysql_fetch_array($result)or die('Error Cannot Get Data. ' . mysql_error())) //Loop is working but It dies here in end.....
{
$sno_22++;
if($sno_22%3==1)
{
echo "Name: ".$row['pt_name']."Mobile: ".$row['pt_mobile']."Email: ".$row['pt_email']."<br />";
}
if($sno_22%3==0)
{
echo "Name: ".$row['pt_name']."Mobile: ".$row['pt_mobile']."Email: ".$row['pt_email']."<br />";
}
if($sno_22%3==2)
{
echo "Name: ".$row['pt_name']."Mobile: ".$row['pt_mobile']."Email: ".$row['pt_email']."<br />";
}
}
}
Please let me know your expert comments.
THanks in advance for your help.
Thanks a lot!