diff --git a/ChangeLog b/ChangeLog index aad9f308d..123c49919 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,10 @@ $Source$ 2005-04-10 Marc Delisle * lang/bulgarian: Updated, thanks to Stanislav Yordanov (stanprog). - + * server_privileges.php: bug #1179969, problem editing a user's profile + (and there was a problem also with the detection of + an already existing user) + 2005-04-09 Alexander M. Turek * libraries/sqlparser.data.php: Added keyword ROUTINE. diff --git a/server_privileges.php b/server_privileges.php index 3443e482f..d8b69d1bc 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -604,8 +604,8 @@ if (!empty($adduser_submit) || !empty($change_copy)) { unset($row); break; } - $res = PMA_DBI_query('SELECT \'foo\' FROM `user` WHERE ' . PMA_convert_using('User') . ' = ' . PMA_convert_using(PMA_sqlAddslashes($username), 'quoted') . ' AND ' . PMA_convert_using('Host') . ' = ' . PMA_convert_using($hostname, 'quoted') . ';'); - if (PMA_DBI_affected_rows() == 1) { + $res = PMA_DBI_query('SELECT \'foo\' FROM `user` WHERE ' . PMA_convert_using('User') . ' = ' . PMA_convert_using(PMA_sqlAddslashes($username), 'quoted') . ' AND ' . PMA_convert_using('Host') . ' = ' . PMA_convert_using($hostname, 'quoted') . ';', NULL, PMA_DBI_QUERY_STORE); + if (PMA_DBI_num_rows($res) == 1) { PMA_DBI_free_result($res); $message = sprintf($strUserAlreadyExists, '[i]\'' . $username . '\'@\'' . $hostname . '\'[/i]'); $adduser = 1; @@ -1152,8 +1152,8 @@ if (empty($adduser) && empty($checkprivs)) { } } echo '' . "\n"; - $res = PMA_DBI_query('SELECT \'foo\' FROM `user` WHERE ' . PMA_convert_using('User') . ' = ' . PMA_convert_using(PMA_sqlAddslashes($username), 'quoted') . ' AND ' . PMA_convert_using('Host') . ' = ' . PMA_convert_using($hostname, 'quoted') . ';'); - if (PMA_DBI_affected_rows($userlink) < 1) { + $res = PMA_DBI_query('SELECT \'foo\' FROM `user` WHERE ' . PMA_convert_using('User') . ' = ' . PMA_convert_using(PMA_sqlAddslashes($username), 'quoted') . ' AND ' . PMA_convert_using('Host') . ' = ' . PMA_convert_using($hostname, 'quoted') . ';', NULL, PMA_DBI_QUERY_STORE); + if (PMA_DBI_num_rows($res) < 1) { echo $strUserNotFound; require_once('./footer.inc.php'); }