When i put stoe procedure inside for loop i am getting error as above.
i am using phpmyadmin
Can anyone plz help me
$sum=0;
for($i=0;$i<10;$i++){
$overall_sat=mysql_query("call daily_sales('HO Bangalore','2013-07-01','2013-07-06')");
while($row=mysql_fetch_row($overall_sat)){?>
<td><?php echo $row['sat'];
$sum=$sum+$row['sat'];?></td>
<?}
}
if(!$overall_sat){
echo mysql_error();
}
?>
My guess is that your stored procedure returns multiple result sets. A new query can only be issued on a connection after all pending results have been fetched. To process procedure call results you need to use
mysqli_next_result()
/mysqli_more_results()
. See example.Stop using mysql, it's outdated.