开发者

mysql fetch_array error

开发者 https://www.devze.com 2023-01-16 07:59 出处:网络
I\'m trying to make a simple mysql_fetch_array but for some reasons I get the error \"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\\wamp\\www\\get.php

I'm trying to make a simple mysql_fetch_array but for some reasons I get the error

"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\get.php on line 5"

$sql = mysql_query("SELECT * FROM mxc WHERE exp_year > 2009 开发者_如何学GoAND status=0 GROUP BY c_number");

 while($row = mysql_fetch_array($sql))
{
....

Any idea what's wrong with my code ? thanks in advance for any help !


Chances are you have a mysql error. Change your query line to this:

$sql = mysql_query("SELECT * FROM mxc WHERE exp_year > 2009 AND status=0 GROUP BY c_number") or trigger_error(mysql_error());

And see what output you get.

0

精彩评论

暂无评论...
验证码 换一张
取 消