From: kkalev Date: Sat, 11 Jan 2003 16:53:06 +0000 (+0000) Subject: Add a directive sql_debug. Add debuging statements in the sql library X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=055b3aa5dba0f08a8e857a28be6ca734f56f3a1f;p=freeradius-dialup-admin.git Add a directive sql_debug. Add debuging statements in the sql library --- diff --git a/Changelog b/Changelog index 8456889..d0704b3 100644 --- a/Changelog +++ b/Changelog @@ -24,6 +24,7 @@ Ver 1.62: * In log_badlogins create a separate sql input file for each sql server and append sql commands to it. If the sql command succeeds we delete the corresponding input file. That way if an sql server is down we store the accounting info in the input file and then send it all when it comes back up. +* Add a directive sql_debug. Add debuging statements in the sql library Ver 1.61: * Add a string encoder for greek * If general_decode_normal_attributes is set then encode attributes in lib/ldap/change_info. In the near future diff --git a/lib/sql/drivers/mysql/functions.php3 b/lib/sql/drivers/mysql/functions.php3 index 1097a98..e558f2c 100644 --- a/lib/sql/drivers/mysql/functions.php3 +++ b/lib/sql/drivers/mysql/functions.php3 @@ -27,21 +27,32 @@ function da_sql_close($link,$config) function da_sql_query($link,$config,$query) { + if ($config[sql_debug] == 'true') + print "DEBUG(SQL,MYSQL DRIVER): Query: $query
\n"; return @mysql_db_query($config[sql_database],$query,$link); } function da_sql_num_rows($result,$config) { + if ($config[sql_debug] == 'true') + print "DEBUG(SQL,MYSQL DRIVER): Query Result: Num rows:: " . @mysql_num_rows($result) . "
\n"; return @mysql_num_rows($result); } function da_sql_fetch_array($result,$config) { + if ($config[sql_debug] == 'true'){ + print "DEBUG(SQL,MYSQL DRIVER): Query Result: "; + print_r(@mysql_fetch_array($result)); + print "
\n"; + } return @mysql_fetch_array($result); } function da_sql_affected_rows($link,$result,$config) { + if ($config[sql_debug] == 'true') + print "DEBUG(SQL,MYSQL DRIVER): Query Result: Affected rows:: " . @mysql_affected_rows($result) . "
\n"; return @mysql_affected_rows($link); }