Jump to content

how to solve this

- - - - -

  • Please log in to reply
2 replies to this topic

#1
tontonskie

tontonskie

    Newbie

  • Members
  • PipPip
  • 15 posts
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in D:\php_localhost\php_quiz\result.php on line 10

#2
rhossis

rhossis

    Learning Programmer

  • Members
  • PipPipPip
  • 46 posts
Hi,

You first need to check why your result is not a valid resource. There might be a problem with your query at an earlier line. Are you doing any error handling? Which extension are you using? try calling mysql_error() or mysqli->error to print out the database error that leads to broken result. Kindly post more information about what you are trying to do.

Regards,
Rhossis

#3
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
Yes, a boolean is either True or False, and in this case mysql_query() will return False on error, which points to your SQL query being incorrect.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users