Monthly Archives: September 2012

Handle mysql_query() error without a variable

Posted by & filed under mySQL, PHP.

Thought this was a neat way of testing/handling query errors without assigning the result to a variable because you don’t need a variable unless you are using SELECT. mysql_error() returns empty string if there was no error, which evaluates to false, as pointed out by jakub-arnold in this post