From: pnixon Date: Mon, 21 Mar 2005 10:35:47 +0000 (+0000) Subject: Trim semicolon from the end of the query if it exists. X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=6688fe31465de07ff23452f7f7be4028d61b0980;p=freeradius-dialup-admin.git Trim semicolon from the end of the query if it exists. --- diff --git a/lib/sql/drivers/oracle/functions.php3 b/lib/sql/drivers/oracle/functions.php3 index 9e5b766..22388dc 100644 --- a/lib/sql/drivers/oracle/functions.php3 +++ b/lib/sql/drivers/oracle/functions.php3 @@ -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 "DEBUG(SQL,OCI DRIVER): Query: $query
\n"; + print "DEBUG(SQL,OCI DRIVER): Query: $trimmed_query
\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 "DEBUG(SQL,OCI DRIVER): Query Result: Num rows:: " . @ocirowcount($statement) . "
\n"; print "DEBUG(SQL,OCI DRIVER): Query Result: Num rows:: " . $rows . "
\n"; } // Unfortunately we need to re-execute because the statement cursor is reset after OCIFetchStatement :-(