Jump to content

[SOLVED] PHP Variable in MySQL Query Problem


Recommended Posts

This code is giving me an error:


(Line 54) $info = mysql_query("SELECT * FROM war3 WHERE Replay# <= " . $first . " order by Replay# desc");
(Line 55) $data = mysql_fetch_array($info);


$first is an integer variable. I have echoed it to test it, and in this particular case, it is "1". This is the error I am getting: "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in W:\www\Files\replays.php on line 55"


The code is supposed to pull all entries from the table 'war3' that have  Replay# of less than/equal to $first. I am unsure which version of MySQL I am using; it is the one that comes with the latest version of Uniform Server.


Thank you for your assistance!


Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

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

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.