Jump to content


Photo

select password returns empty set


  • Please log in to reply
7 replies to this topic

#1 zyonsherlock

zyonsherlock
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationPhilippines

Posted 09 October 2006 - 08:58 AM

i've got a problem with my query, at first i thought it was in my php script, but it doesn't return any error. after that i run my query in mysql prompt, it seems that whenever i run a query with a "where password = password("password");", it returns an empty set. I search for some answers here and in other online forums, even in mysql ab but nothing helped me with this problem. i'm searching for errors for the past 2 days already, i don't know what to do with this, it's making me nuts already! anyone? help? please?  :'( all answers are welcome...thanks in advance! 


#2 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 09 October 2006 - 04:30 PM

Not sure, but this might be the password() compability issue in MySql 4.1 and later: http://dev.mysql.com...ssword-use.html

#3 zyonsherlock

zyonsherlock
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationPhilippines

Posted 10 October 2006 - 02:39 AM

i'm using mysql 5.0.22, i'm using wamp, is wamp has something to do with my problem?

#4 btherl

btherl
  • Staff Alumni
  • Advanced Member
  • 3,893 posts
  • LocationAustralia

Posted 10 October 2006 - 07:29 AM

What happens if you do "SELECT password("password")", and then do a query using the output of that?  Are there any matching columns?  And does the output of that first query make sense?

#5 zyonsherlock

zyonsherlock
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationPhilippines

Posted 10 October 2006 - 10:15 AM

when i do the select "password('password')", it shows the encrypted version, but the encrypted version is 1 (letter or number) longer than the one that was selected in "select * from table;" .
e.g.
mysql>select * from users;

user    password
duh      p102p394kr843pouk

mysql>select password('password');
           
              password('password')
              p102p394kr843pouke

When i copy that encrypted one and make a query for it, it still returns an empty set
e.g.
select username, password where username="duh" and password = "1o2j43ik4j34kjoipo";

is it the encryption of passwords?coz i think thats the problem. i've been stuck with this problem for the past 3 days already, and i dont find any typo errors or any errors at all with my query, if thats the problem, what should i do?

#6 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 10 October 2006 - 03:32 PM

Are you sure you're not accidentally truncating the encrypted password?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#7 zyonsherlock

zyonsherlock
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationPhilippines

Posted 12 October 2006 - 03:09 AM

hi! thanks for your help! i solved my problem a while ago. i've read the documentation of mysql for this one and i've learned that my problem was my password length, it was set to 40, it must be set to at least 41 bytes so that it can accomodate the long hashes, i've set mine to 45 just in case, thanks again!!!  ;D

#8 zyonsherlock

zyonsherlock
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationPhilippines

Posted 12 October 2006 - 03:22 AM

just in case someone sees this topic and want some more information about it check this link: dev.mysql.com/doc/refman/4.1/en/password-hashing.html. this link end my 3day brain seizure! ;D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users