function Checkcanceluserstop ($phoneNum) {$con = mysql_connect ("localhost", "root", ""), if (! $con) {echo ""; echo ""; return;} $result = mysql_select_db ("Teleservice", $con), if (! $result) {echo ""; echo "; return;} $result = mysql_query ("SET NAMES ' GBK '"), if (! $result) {echo ""; echo "; return;} $query = "Select state from phonedetail where phonedetail.phonenum = $phoneNum"; if ($result) {echo ""; echo "";} else {echo "; echo" "; return;} $oldState = "Open normally", while ($row = Mysql_fetch_row ($result)) {echo ' in while loop ... ' $oldState = $row [0];echo $oldState;} if ($oldState = = "Active Stop") {echo "yes"; return true;} else {echo "no"; return false;} Mysql_close ($con);}
Problem: Through debugging, the original status of the number can already be queried successfully. At this time $result = 1, but the back fetch_row, cannot enter into the while loop, there is a warning: warning:mysql_fetch_row () expects parameter 1 to be resource, Boolean given in H:\wamp\www\frr_cancelUserStop.php on line 58
Ask: $result = 1 is really 1 (true) Ah, then why not into the loop?
How can we get results?
Thank you, everyone!
Reply to discussion (solution)
I know how to be wrong, write a few words. Excuse me.
The SQL command executes
I have also encountered this kind of mistake, can I help to look?
Warning:mysql_fetch_row () expects parameter 1 to BES resource, boolean given in D:\WWW\blog\show_pub.php on line 7
Code:
Error_reporting (E_all^e_notice);
Session_Start ();
Include "conn/conn.php";
$pubsql = "SELECT * from Tb_public where id=". $_get[' id '];
$pubrst = mysql_query ($pubsql, $link);
$pubrow = Mysql_fetch_row ($pubrst);
echo "
". $pubrow [2]."
";
?>