mysql_fetch_row(): supplied argument is not a valid MySQL result resource,何人能解?该如何解决
程序员文章站
2024-01-01 19:43:46
...
mysql_fetch_row(): supplied argument is not a valid MySQL result resource,何人能解?
代码如下:
/*
* Created on 2012-1-1
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
$conn = mysql_connect("localhost","root","") or die ("连接出错");
mysql_select_db("dongxinb",$conn);
$sql="SELECT * FROM 'word'";
$query=mysql_query($sql,$conn);
$row=mysql_fetch_array($query);
echo $row[name];
?>
其中name为dongxinb数据库word表的字段。
错误信息:Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\wamp\www\word\1.php on line 13
其中INSERT能正常插入。
------解决方案--------------------
SQL 错了
修改成
$sql="SELECT * FROM word";
------解决方案--------------------
代码如下:
/*
* Created on 2012-1-1
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
$conn = mysql_connect("localhost","root","") or die ("连接出错");
mysql_select_db("dongxinb",$conn);
$sql="SELECT * FROM 'word'";
$query=mysql_query($sql,$conn);
$row=mysql_fetch_array($query);
echo $row[name];
?>
其中name为dongxinb数据库word表的字段。
错误信息:Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\wamp\www\word\1.php on line 13
其中INSERT能正常插入。
------解决方案--------------------
SQL 错了
修改成
$sql="SELECT * FROM word";
------解决方案--------------------
- PHP code
姓名:{$row['name']} | |
Message:{$row['words']} | 更新时间:{$row['date']} |
相关文章
相关视频
推荐阅读
-
mysql_fetch_row(): supplied argument is not a valid MySQL result resource,何人能解?该如何解决
-
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result res,该怎么解决
-
mysql_fetch_row(): supplied argument is not a valid MySQL result resource,何人能解?该如何解决
-
mysql_fetch_array(): supplied argument is not a valid MySQL result resource,该如何处理
-
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result res,该怎么解决
-
mysql_fetch_array(): supplied argument is not a valid MySQL result resource,该怎么解决
-
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resour,该怎么解决
-
mysql_fetch_array(): supplied argument is not a valid MySQL result resource解决方法
-
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resour,该怎么解决
-
求救:mysql_fetch_row(): supplied argument is not a valid MySQL result resource