MySQL Forums
Forum List  »  PHP

Re: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
Posted by: Rick James
Date: October 18, 2009 12:22PM

1. After the call to mysql_query (for that matter, after ANY call to ANY api), check for errors, something like:
$err = mysql_error(); if ($err) echo $err;

2. Escape strings (mysql_real_escape_string()) before putting them into a SQL statement. What do you think will happen if the string contains a quote?

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.