Jump to content

Why Isn't This Working?


Twango

Recommended Posts

function hasP($idx, $u){$dhas = mysql_query("SELECT * FROM hpowerups WHERE id = '$idx'");$dhas = mysql_fetch_array($dhas);$dhas = $dhas['has'];if ($dhas == "yes"){return $dhas;}else{return "no";}} Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/appattac/public_html/aadimensions/homepage.php on line 21

Link to comment
Share on other sites

That means that the mysql_query() returned an error.Put error handling:

$dhas = mysql_query("SELECT * FROM hpowerups WHERE id = '$idx'"); if(!$dhas) {  echo mysql_error();  exit;}$dhas = mysql_fetch_array($dhas);$dhas = $dhas['has'];

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...