[Phpmyadmin-devel] about mysql.user

Hi, can I assume that the password is always the third field of mysql.user? Marc

On Thu, 8 Aug 2002, Marc Delisle wrote:
can I assume that the password is always the third field of mysql.user? I don't think so.
Why not just specify the fields you want, in the order you want in your query? -- Robin Hugh Johnson E-Mail : robbat2@orbis-terrarum.net Home Page : http://www.orbis-terrarum.net/?l=people.robbat2 ICQ# : 30269588 or 41961639

Robin Johnson wrote:
On Thu, 8 Aug 2002, Marc Delisle wrote:
can I assume that the password is always the third field of mysql.user?
I don't think so.
Why not just specify the fields you want, in the order you want in your query?
Because the goal is to find if the name of the password field in mysql.user is Password or password, and I wanted to avoid doing a loop for each of the fields, looking for "assword". I am implementing the fix in user_details as is, maybe someone will come with a better solution. Marc

At 08:12 09.08.2002 -0400, you wrote:
Robin Johnson wrote:
On Thu, 8 Aug 2002, Marc Delisle wrote:
can I assume that the password is always the third field of mysql.user? I don't think so.
Why not just specify the fields you want, in the order you want in your query? Because the goal is to find if the name of the password field in mysql.user is Password or password, and I wanted to avoid doing a loop for each of the fields, looking for "assword".
I am implementing the fix in user_details as is, maybe someone will come with a better solution.
hmm dont know why it would be different (Password or password) but how about a simple solution *G* show fields from mysql.user like "%assword"
Marc
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel

Good idea, thanks :) "Thomas Bähr [Office]" a écrit :
At 08:12 09.08.2002 -0400, you wrote:
Robin Johnson wrote:
On Thu, 8 Aug 2002, Marc Delisle wrote:
can I assume that the password is always the third field of mysql.user? I don't think so.
Why not just specify the fields you want, in the order you want in your query? Because the goal is to find if the name of the password field in mysql.user is Password or password, and I wanted to avoid doing a loop for each of the fields, looking for "assword".
I am implementing the fix in user_details as is, maybe someone will come with a better solution.
hmm dont know why it would be different (Password or password) but how about a simple solution *G*
show fields from mysql.user like "%assword"
Marc
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
-- Marc Delisle

----- Original Message ----- From: "Thomas Bähr [Office]" <baehr@glaswald.de>
hmm dont know why it would be different (Password or password) but how about a simple solution *G*
show fields from mysql.user like "%assword"
Just forget my previous mail, this solution is the better one ;-) Alexander

----- Original Message ----- From: "Marc Delisle" <DelislMa@CollegeSherbrooke.qc.ca>
Robin Johnson wrote:
On Thu, 8 Aug 2002, Marc Delisle wrote:
can I assume that the password is always the third field of mysql.user?
I don't think so.
Why not just specify the fields you want, in the order you want in your query?
Because the goal is to find if the name of the password field in mysql.user is Password or password, and I wanted to avoid doing a loop for each of the fields, looking for "assword".
What about this: $res = PMA_mysql_query($sql_query, $dbh); $row = mysql_fetch_array($res, MYSQL_ASSOC); if (isset($row['Password'])) { $pw_key = 'Password'; } else if (isset($row['password'])) { $pw_key = 'password'; } else { $pw_key = FALSE; } $pw_key should now contain the correct column name for the password field or FALSE is there is neither a "Password" nor a "password" field. Regards, Alexander
participants (4)
-
"Thomas Bähr [Office]"
-
Marc Delisle
-
Rabus
-
Robin Johnson