X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ab6a99677293c9ddb96a717f03b8a009e98ab955..e842d8793c1c416a75bbae39c004184f1ed66289:/lib/cmd.php diff --git a/lib/cmd.php b/lib/cmd.php index 0c9201a8..c73074a1 100644 --- a/lib/cmd.php +++ b/lib/cmd.php @@ -143,3 +143,13 @@ echo "\n"; exit; } + + function chksql($oSql, $sMsg = false) + { + if (PEAR::isError($oSql)) + { + fail($sMsg || $oSql->getMessage(), $oSql->userinfo); + } + + return $oSql; + }