开发者

mysql fetch_array error

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜