Could someone PLEASE tell me why this doesn't work?
function result_to_array($result){
$res_array = array();
for ($count=0; $row=@mysql_fetch_array($result); $count++){
$res_array[$count] = $row;
}
return $res_array;
}
I'm assuming I could get the job done just as well using something like this:
function result_to_array($result){
$res_array = array();
$count = 0;
while ($row = mysql_fetch_array($result)){
$res_array[$count] = $row;
$count++;
}
return $res_array;
}
but I'm curious why the first won't work.