]> git.entuzijast.net Git - freeradius-dialup-admin.git/commitdiff
Trim semicolon from the end of the query if it exists.
authorpnixon <pnixon>
Mon, 21 Mar 2005 10:35:47 +0000 (10:35 +0000)
committerpnixon <pnixon>
Mon, 21 Mar 2005 10:35:47 +0000 (10:35 +0000)
lib/sql/drivers/oracle/functions.php3

index 9e5b7667668a2c3cac4b78f4f1654a89f051a5bc..22388dcbaf1f1c43ffad8c8ed3ad0f2325a4bded 100644 (file)
@@ -54,10 +54,11 @@ function da_sql_escape_string($string)
 
 function da_sql_query($link,$config,$query)
 {
+       $trimmed_query = rtrim($query, ";");
        if ($config[sql_debug] == 'true') {
-               print "<b>DEBUG(SQL,OCI DRIVER): Query: <i>$query</i></b><br>\n";
+               print "<b>DEBUG(SQL,OCI DRIVER): Query: <i>$trimmed_query</i></b><br>\n";
        }
-       $statement = OCIParse($link,$query);
+       $statement = OCIParse($link,$trimmed_query);
        OCIExecute($statement);
        return $statement;
 }
@@ -68,7 +69,6 @@ function da_sql_num_rows($statement,$config)
        $rows = OCIFetchStatement($statement,$res); 
 
         if ($config[sql_debug] == 'true'){
-                // print "<b>DEBUG(SQL,OCI DRIVER): Query Result: Num rows:: " . @ocirowcount($statement) . "</b><br>\n";
                 print "<b>DEBUG(SQL,OCI DRIVER): Query Result: Num rows:: " . $rows . "</b><br>\n";
         }
        // Unfortunately we need to re-execute because the statement cursor is reset after OCIFetchStatement :-(