您好,欢迎访问一九零五行业门户网

为何总是Warning: mysql_fetch_object(): supplied argument is not a valid MySQL resul

为什么总是warning: mysql_fetch_object(): supplied argument is not a valid mysql resul
为什么总是
warning: mysql_fetch_object(): supplied argument is not a valid mysql result resource in d:\appserv1\www\forum\index.php on line 46
代码:
               $id = $row[id];
   $res=mysql_query(select count(*) as total from reply where topic id='$id');
   $r = mysql_fetch_object($res);
大家帮帮忙
------解决方案--------------------
topic id='$id'  //这里错了吧
------解决方案--------------------
你把sql语句放到mysql里面运行,看有没有结果
------解决方案--------------------
最后的$id用连字符拼接吧,别直接写到sql里
------解决方案--------------------
topic是另外一张表那得采用连接查询或者是多表符合查询
其它类似信息

推荐信息