![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
New to the CF scene Join Date: Jan 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
problem with query using password() function
I've created a simple table called users. This table contains four columns. First_Name, Last_Name, User_Name, Password. I've used the password() function when inserting a user. I have read the documentation on using other types of encryption, but it's killing me that I can't get this to work. Robert has a User_Name of "Bob" and a password of password('tomato').
=============================== HOW I ADDED BOB insert into users values("Robert","Evans","bob",password('tomato')); 1 row added yada yada HOW I QUERY BOB select * from users where User_Name="bob" and password=password('tomato'); Empty Set =============================== That exact same query is in a tutorial for a simple PHP login form, but an empty set is returned even in the command prompt using MySQL by itself, therefore the script cannot move on. Thanks for any help. soren |
|
|
|
|
|
PM User | #2 | |
|
Master Coder ![]() ![]() Join Date: Jul 2002
Posts: 6,589
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
Welcome here!
should work. make sure you entered the exact same pasword and username (same case and all). but you realy shouldn't use the mysql PASSWORD() function cause different hashingalgortimes are used in different mysql-version, so you can't upgrade your mysql-version!which makes it completely useless for you. the reason for this is Quote:
__________________
Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html |
|
|
|
|
|
|
PM User | #3 |
|
New to the CF scene Join Date: Jan 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
sha1 & md5 work...password() does not
Thank you for your reply and for welcoming me. I can see that I will be spending a lot of time here.
Well, it seems to work ok with sha1 and md5, but still not password(). All of this is not too big of a deal since I didn't plan on using password(). I just wanted to see it work. However, I am working with a site that is using cPanel. They have MySQL version 4.0.22. Will sha1 and md5 still work? Can I still not worry about password()? soren |
|
|
|
|
|
PM User | #4 |
|
Regular Coder ![]() Join Date: Oct 2003
Location: Australia
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
yes. sha1 and md5 are php functions. will work with any MySQL versions, to the best of my knowledge.
__________________
Day Dream Graphics |
|
|
|
|
|
PM User | #6 | |
|
Master Coder ![]() ![]() Join Date: Jul 2002
Posts: 6,589
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
Quote:
There are identical PHP functions that will work regardless of your db-version of format. I personnaly use the PHP function to keep my code db-independent. but there is no real diffenrence between PHP Code:
PHP Code:
__________________
Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|