Jump to content

Why Isn't This Working?


Twango
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...