]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/cmd.php
introduce chksql function for phpscripts
[nominatim.git] / lib / cmd.php
index 0c9201a81b4023a4a2dcc3f39584dba0b990ec66..c73074a18517d2674e8fc80debdf7caa89b72ea6 100644 (file)
                echo "\n";
                exit;
        }
+
+       function chksql($oSql, $sMsg = false)
+       {
+               if (PEAR::isError($oSql))
+               {
+                       fail($sMsg || $oSql->getMessage(), $oSql->userinfo);
+               }
+
+               return $oSql;
+       }