From 69de1f06f0f5ccec93c6092fe49d5d456f9c80ac Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Fri, 21 Sep 2007 19:33:10 +0000 Subject: [PATCH] functions.inc.php: fix incorrect usage of mysqli_error(...) git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@65 a1433add-5e2c-0410-b055-b7f2511e0802 --- functions.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index 1539255e..86b68b07 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -1270,8 +1270,14 @@ function db_query ($query) if (!is_resource($link)) $link = db_connect (); - if ($CONF['database_type'] == "mysql") $result = @mysql_query ($query, $link) or die ("

DEBUG INFORMATION:
Invalid query: " . mysql_error() . "$DEBUG_TEXT"); - if ($CONF['database_type'] == "mysqli") $result = @mysqli_query ($link, $query) or die ("

DEBUG INFORMATION:
Invalid query: " . mysqli_error() . "$DEBUG_TEXT"); + if ($CONF['database_type'] == "mysql") + { + $result = @mysql_query ($query, $link) or die ("

DEBUG INFORMATION:
Invalid query: " . mysql_error() . "$DEBUG_TEXT"); + } + if ($CONF['database_type'] == "mysqli") + { + $result = @mysqli_query ($link, $query) or die ("

DEBUG INFORMATION:
Invalid query: " . mysqli_error($link) . "$DEBUG_TEXT"); + } if ($CONF['database_type'] == "pgsql") { $result = @pg_query ($link, $query) or die ("

DEBUG INFORMATION:
Invalid query: " . pg_last_error() . "$DEBUG_TEXT");