mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
introduce chksql function for phpscripts
Checks SQL query results for errors and bails out if it finds one. Avoids some heavy code duplication all over the place.
This commit is contained in:
10
lib/cmd.php
10
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user