I know that mySQL errors are caught in mysql_error() and I find that
function extremely useful (kudos!). However, I have several queries in a few
scripts of mine but am wondering if anyone has written a small function that
catches errors and outputs them. What I mean is lets say I have a block of
code like so:
$result = mysql_query("SELECT field1, field2 FROM users WHERE userLogin =
'$authusername' AND userPassword = '$authpassword'");
Instead of a small loop under my query that is like so:
if (mysql_error()) {
echo "Error: ".mysql_error();
exit;
}
I'd like to be able to call a function that does this instead of adding this
if statement after all my queries...so...anyone do something similar?
Jeff
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php