$result=mysql_query("SELECT * FROM playerlocations WHERE player<>'0'");
$returntext="";
while($row=mysql_fetch_array($result))
{
if($returntext!=""){$returntext.="&";}
$returntext.=$row['player']."#".$row['locations'];
}
the error message claims that $result isn’t a valid result set. I tested it in phpmyadmin, and it worked. I don’t know why it won’t work here, please help.
It says it isn’t a valid result set. That doesn’t necessarily mean it isn’t a valid query. (Although
!=instead of<>would be nice.)To figure out why it’s not valid, output the result of calling
mysql_error()after running the query:It will tell you what MySQL reports as the error message.
One obvious thing to check: have you opened the connection (with
mysql_connecst()) before running the query?