Question
Warning: mysql_fetch_assoc()
Hi
i make recordset and make a function that iterate through it like this
function getname($id)
{
if($id==0){
echo "...;
return ;
}
while ($row_rs_father = mysql_fetch_assoc($rs_father)){ // this line generates the warning !!!
if($row_rs_father['id'] == $id)
echo $row_rs_father['name'];
return;
}
}
and the $id is passed corerectly but the while line generates error why?
when debug i found that $row_rs_father is null any idea?
and sql statement is right because those have $id=0 are printed
thanks in advance.
i make recordset and make a function that iterate through it like this
function getname($id)
{
if($id==0){
echo "...;
return ;
}
while ($row_rs_father = mysql_fetch_assoc($rs_father)){ // this line generates the warning !!!
if($row_rs_father['id'] == $id)
echo $row_rs_father['name'];
return;
}
}
and the $id is passed corerectly but the while line generates error why?
when debug i found that $row_rs_father is null any idea?
and sql statement is right because those have $id=0 are printed
thanks in advance.
