function checkCancelUserStop($phoneNum){ $con = mysql_connect("localhost", "root", ""); if(!$con) { echo "<script language=\"JavaScript\"> alert('数据库连接失败!'); </script>"; echo "<script language='javascript' type='text/javascript'>"; echo "window.location.href='$url'"; echo "</script>"; return; } $result = mysql_select_db ("teleservice",$con); if(!$result) { echo "<script language=\"JavaScript\"> alert('选择数据库失败!'); </script>"; echo "<script language='javascript' type='text/javascript'>"; echo "window.location.href='$url'"; echo "</script>"; return; } $result = mysql_query("SET NAMES 'GBK'"); if(!$result) { echo "<script language=\"JavaScript\"> alert('设置字符集失败!'); </script>"; echo "<script language='javascript' type='text/javascript'>"; echo "window.location.href='$url'"; echo "</script>"; return; } $query = "select state from phoneDetail where phoneDetail.phoneNum = $phoneNum"; if($result) { echo "<script language=\"JavaScript\"> alert('查询号码原状态成功!'); </script>"; echo "<script language='javascript' type='text/javascript'>"; echo "window.location.href='$url'"; echo "</script>"; } else { echo "<script language=\"JavaScript\"> alert('查询号码原状态失败!'); </script>"; echo "<script language='javascript' type='text/javascript'>"; echo "window.location.href='$url'"; echo "</script>"; 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 コマンドが実行されます
私もこのエラーに遭遇しました。確認を手伝ってもらえますか?
警告: mysql_fetch_row() はパラメータ 1 が D:WWWblogshow_pub.php の 7 行目で指定されたブール値であることを想定しています
コード:
session_start();
include "con n /conn.php";
$pubsql = "select * from tb_public where id= ".$_GET['id'];
$pubrst = mysql_query($pubsql,$link);
$pubrow = mysql_fetch_row($pubrst) ;
echo "
".$pubrow[2]."";