gpt4 book ai didi

php - MYSQL_NUM_ROWS期望参数1为资源

转载 作者:行者123 更新时间:2023-11-29 00:49:46 25 4
gpt4 key购买 nike

Possible Duplicate:
PHP (MySQL) error : “Warning: mysql_num_rows() expects parameter 1 to be resource”
我的代码出现了一个恼人的错误。。

48. mysql_select_db("serverip_gamepwn", $con);
49. $username_session = $_COOKIE['GamePwN_LOL_Username'];
50. $username_session = mysql_real_escape_string($username_session);
51. $result = mysql_query("SELECT * FROM orders WHERE username='$username_session'");
52. $count = mysql_num_rows($result);
53. if($count != 1){

错误代码为:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/serverip/public_html/gamepwn.net/lol/status.php on line 52

最佳答案

替换

$count = mysql_num_rows($result);

具有
$count = mysql_num_rows($result) or die(mysql_error());

看看上面写了什么

关于php - MYSQL_NUM_ROWS期望参数1为资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9045475/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com