Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource - TOMMYHU - 专注互联网开发及运营技术,提供相关资料及软件下载,奇趣网络时事评论!
Jun 10

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource 不指定

tommyhu , 09:24 , DBA » MYSQL , Comments(2) , Trackbacks(0) , Reads(18078) , Via Original Large | Medium | Small
错误提示
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource

在php manual中找到答案了。在reslut为0的时候会出现这个错误,这时候,要检查一下表名,数据库名,连接等等。。


Why do I get an error that looks something like this: "Warning: 0 is not a MySQL result index in on line " or "Warning: Supplied argument is not a valid MySQL result resource in on line "?



You are trying to use a result identifier that is 0. The 0 indicates that your query failed for some reason. You need to check for errors after submitting a query and before you attempt to use the returned result identifier. The proper way to do this is with code similar to the following:


<?php

$result = mysql_query("SELECT * FROM tables_priv");
if (!$result) {
     echo mysql_error();
     exit;
}
?> or <?php

$result = mysql_query("SELECT * FROM tables_priv")
     or die("Bad query: " . mysql_error());
?>

▲返回顶部

互联网开发网友 Email Homepage
2011/06/29 16:06
半夜灯水五更鸡,恰是男女念书时。
互联网开发网友 Email Homepage
2010/10/31 11:54
声响的根部
・小皮
像被摔出体外的口净 比事物的称号
更直言不讳 蒙伤的部位现埋正在
糖衣的药片
空巢挪动 盐的穹底腌造灭挽歌
下战书的阴光徐徐出过火底
那非最旺盛的磷水 为徐病指亮了圆背
如同一匹做案先的狼
凌厉的侵犯者
他的臊气 剥予了己类对于里的思惟
谁在用本人的暗影敌视人
争人越陷越淡 自收秃到足踵
一类蓝色的血液 笔挺天
贯串家传的傲骨战愿望
如一个哑己流于舌根的脚势
里情萎伸 不管自本性抵达
或者泅渡口笨 再围歼念象
一类语直言用另一类言语来正文
谣言被啄空
如金女外部归光往
照笼罩 人正在磨砺外透辟旧暮年的明伤
正在半地面屈出一只叛徒的脚
请您收直言
Pages: 1/1 First page 1 Final page
Add a comment

Nickname

emotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemot