if we are going to write out an sql error message we might as well include the full query

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1241 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
David Goodwin 13 years ago
parent 5a18a1e48b
commit 3c880aa0c6

@ -1611,12 +1611,12 @@ function db_query ($query, $ignore_errors = 0) {
if (!is_resource($link)) $link = db_connect ();
if ($CONF['database_type'] == "mysql") $result = @mysql_query ($query, $link)
or $error_text = "<p />DEBUG INFORMATION:<br />Invalid query: " . mysql_error($link) . "$DEBUG_TEXT";
or $error_text = "<p />DEBUG INFORMATION:<br />Invalid query ($query) : " . mysql_error($link) . "$DEBUG_TEXT";
if ($CONF['database_type'] == "mysqli") $result = @mysqli_query ($link, $query)
or $error_text = "<p />DEBUG INFORMATION:<br />Invalid query: " . mysqli_error($link) . "$DEBUG_TEXT";
or $error_text = "<p />DEBUG INFORMATION:<br />Invalid query ($query) : " . mysqli_error($link) . "$DEBUG_TEXT";
if ($CONF['database_type'] == "pgsql") {
$result = @pg_query ($link, $query)
or $error_text = "<p />DEBUG INFORMATION:<br />Invalid query: " . pg_last_error() . "$DEBUG_TEXT";
or $error_text = "<p />DEBUG INFORMATION:<br />Invalid query ($query): " . pg_last_error() . "$DEBUG_TEXT";
}
if ($error_text != "" && $ignore_errors == 0) die($error_text);

Loading…
Cancel
Save