时间:2021-07-01 10:21:17 帮助过:24人阅读
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 = "正常开通"; while($row = mysql_fetch_row($result)) { echo "in while loop..."; $oldState = $row[0]; echo $oldState; } if($oldState == "主动停机") { echo "yes"; return true; } else { echo "no"; return false; } mysql_close($con);}
我知道怎么错了,少写了一句话。不好意思。
SQL 指令为执行
我也遇到了这种错误,能不能帮忙看下?
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in D:\WWW\blog\show_pub.php on line 7
代码:
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]."";