Jump to content

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, string given in


visionaire

Recommended Posts

I have a strange error from the code below. I have run the query with the resulting values in PHPMyAdmin and it works fine.

 

The code is:

$query = "SELECT * FROM sn_matches WHERE (P1_ID='".$P1_ID."' AND P2_ID='".$P2_ID."') OR (P1_ID='".$P2_ID."' AND P2_ID='".$P1_ID."')";
while($row = mysql_fetch_assoc($query)){

 

The error is:

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, string given in /customers/ronflorax.com/ronflorax.com/httpd.www/snookerstats/h2h.php on line 21

 

Line 21 is the one which has mysql_fetch_assoc on it.

 

Any help would be much appreciated!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.