Jump to content

[SOLVED] query not working..


acctman

Recommended Posts

is there a reason why this query is not work

err: PHP Warning:  mysql_result(): supplied argument is not a valid MySQL result resource in ...

$date = mysql_result(mysql_query("SELECT m_date, m_id FROM rate_members WHERE m_id=$id"), 0, "m_date");		

Link to comment
Share on other sites

is there a reason why this query is not work

err: PHP Warning:  mysql_result(): supplied argument is not a valid MySQL result resource in ...

$date = mysql_result(mysql_query("SELECT m_date, m_id FROM rate_members WHERE m_id=$id"), 0, "m_date");		

 

Yeah .. there's always a reason.

Anyway, I'd say save your your mysql_query into a variable, i.e. $result = mysql_query("...");.  It makes your code look much cleaner and easier to troubleshoot.  That way, you can print out what your query returns and check to see if that's what you want.

Another thing that I see in your code: You're querying $id.  $id exists in PHP, not MySQL.  That's another reason why you should save it as a separate variable.  Concatenate your string.  You're including the text $id right now, not THE VALUE of $id, which is different.

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.