errors when invalid login

This commit is contained in:
Marc Delisle
2004-06-15 00:16:59 +00:00
parent 567f7f1815
commit 0123495cb7
2 changed files with 6 additions and 4 deletions

View File

@@ -20,6 +20,8 @@ $Source$
* libraries/common.lib.php: proper revision check
* libraries/select_theme.lib.php: remove unneeded counter, and fix
undefined $PHP_SELF
* libraries/dbi/mysql.dbi.lib.php: errors on mysql_errno() when the
login is invalid
2004-06-13 Marc Delisle <lem9@users.sourceforge.net>
* many files: redesign part 3, thanks to Michael Keck (mkkeck).

View File

@@ -1,7 +1,7 @@
<?php
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
error_reporting(E_ALL);
/**
* Interface to the classic MySQL extension
*/
@@ -197,13 +197,13 @@ function PMA_DBI_getError($link = NULL) {
if (mysql_errno()) {
$error = mysql_errno();
$error_message = mysql_error();
} else {
} elseif ($link) {
$error = mysql_errno($link);
$error_message = mysql_error($link);
}
// keep the error number for further check after the call to PMA_DBI_getError()
if ($error) {
if (isset($error) && $error) {
$GLOBALS['errno'] = $error;
} else {
return FALSE;
@@ -212,7 +212,7 @@ function PMA_DBI_getError($link = NULL) {
// Some errors messages cannot be obtained by mysql_error()
if ($error && $error == 2003) {
$error = '#' . ((string) $error) . ' - ' . $GLOBALS['strServerNotResponding'];
} elseif ($error && PMA_MYSQL_INT_VERSION >= 40100) {
} elseif ($error && defined('PMA_MYSQL_INT_VERSION') && PMA_MYSQL_INT_VERSION >= 40100) {
$error = '#' . ((string) $error) . ' - ' . $error_message;
} elseif ($error) {
$error = '#' . ((string) $error) . ' - ' . PMA_convert_display_charset($error_message);