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");		

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.