Reputation: 1669
$query = sprintf("select * from sometable;");
$result = mysql_query($query) or die (mysql_error());
modified to:
$query = sprintf("select * from sometable;");
$result = mysql_query($query) or $DBError=true;
Now I want to execute 2 statements if the query fails, is this possible using the "short above"? e.g. something like this:
$query = sprintf("select * from sometable;");
$result = mysql_query($query) or {$DBError=true; $ErrorCode=0;}
Upvotes: 1
Views: 70