From 1c3bb170a13c7cc9d7103b5febccba9cb4cc9a20 Mon Sep 17 00:00:00 2001 From: kkalev Date: Mon, 13 Jan 2003 08:01:43 +0000 Subject: [PATCH] Fix a small problem with debugging --- Changelog | 1 + lib/sql/drivers/mysql/functions.php3 | 5 +++-- lib/sql/drivers/pg/functions.php3 | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Changelog b/Changelog index ffefbe7..f0c0dfb 100644 --- a/Changelog +++ b/Changelog @@ -31,6 +31,7 @@ Ver 1.62: * Don't include user_info.php3 in the user_test page. * Make things a little bit more simple in lib/ldap/change_attrs.php3 * Fix a small bug in lib/ldap/create_user.php3. Unset the mod array before adding any values to it. +* Fix a small problem with debugging 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 78fe0a5..42ce98b 100644 --- a/lib/sql/drivers/mysql/functions.php3 +++ b/lib/sql/drivers/mysql/functions.php3 @@ -41,12 +41,13 @@ function da_sql_num_rows($result,$config) function da_sql_fetch_array($result,$config) { + $row = @mysql_fetch_array($result); if ($config[sql_debug] == 'true'){ print "DEBUG(SQL,MYSQL DRIVER): Query Result: "; - print_r(@mysql_fetch_array($result)); + print_r($row); print "
\n"; } - return @mysql_fetch_array($result); + return $row; } function da_sql_affected_rows($link,$result,$config) diff --git a/lib/sql/drivers/pg/functions.php3 b/lib/sql/drivers/pg/functions.php3 index 4c5a10b..b65e1f3 100644 --- a/lib/sql/drivers/pg/functions.php3 +++ b/lib/sql/drivers/pg/functions.php3 @@ -43,12 +43,12 @@ function da_sql_num_rows($result,$config) function da_sql_fetch_array($result,$config) { - if ($config[sql_debug] == 'true'){ + $row = @pg_fetch_array($result,$config[tmp_pg_array_num][$result]++,PGSQL_ASSOC); + if ($row && $config[sql_debug] == 'true'){ print "DEBUG(SQL,PG DRIVER): Query Result: "; - print_r(@pg_fetch_array($result,$config[tmp_pg_array_num][$result]++,PGSQL_ASSOC)); + print_r($row); print "
\n"; } - $row = @pg_fetch_array($result,$config[tmp_pg_array_num][$result]++,PGSQL_ASSOC); if (!$row) $config[tmp_pg_array_num][$result] = 0; return $row; -- 2.39.5