From 58bb4d5c78a8cc7f71039c38cf3d6dcc3754c71e Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 9 Aug 2002 13:01:24 +0000 Subject: [PATCH] better fix --- ChangeLog | 3 ++- user_details.php3 | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22a42d88c..3b7f14196 100755 --- a/ChangeLog +++ b/ChangeLog @@ -6,7 +6,8 @@ $Id$ $Source$ 2002-08-09 Marc Delisle - * user_details.php3: bug 591602, mysql.user lowercase "password" + * user_details.php3: bug 591602, mysql.user lowercase "password", + thanks to Thomas Bähr * lang/romanian: update, thanks to Valics Lehel 2002-08-09 Robin Johnson diff --git a/user_details.php3 b/user_details.php3 index f31e8e81d..187d35221 100644 --- a/user_details.php3 +++ b/user_details.php3 @@ -997,11 +997,11 @@ if (PMA_mysql_error()) { //$result = @PMA_mysql_query('SELECT COUNT(Password) FROM mysql.user'); //$password_field = (($result && PMA_mysql_result($result, 0)) ? 'Password' : 'password'); -$result = @PMA_mysql_query('Select * from user limit 1'); +// using a syntax that works with older and recent MySQL, +// and assumes that the field name ends with "assword": +$result = @PMA_mysql_query('SHOW FIELDS FROM user FROM mysql LIKE \'%assword\''); if ($result) { -// assumes that the password is always the third field of mysql.user - $field_info = PMA_mysql_fetch_field($result,2); - $password_field = $field_info->name; + $password_field = PMA_mysql_result($result, 0); } /**