infinite loop
Posted: Fri Nov 16, 2007 11:56 pm
Why am i getting infinite loop when i execute below code?
//code in class file
Code: Select all
$sql_oproposals = "SELECT * FROM " . $this->tbl_suggestmatches . " WHERE report_card_status = 'No' AND ClientID = " . $client_id;
// $total_oproposals = $this->GetNumRows($sql_oproposals);
while ($mysql_array = $this->FetchAll($sql_oproposals)) {
echo $mysql_array['id'];
}//code in class file
Code: Select all
function FetchAll($sql_query)
{
$num_rows_res=mysql_query($sql_query);
$mysql_array = mysql_fetch_assoc($num_rows_res);
return $mysql_array;
}