Jump to content


Photo

password problem mysql


  • Please log in to reply
2 replies to this topic

#1 thehigherentity

thehigherentity
  • Members
  • PipPipPip
  • Advanced Member
  • 49 posts

Posted 16 June 2006 - 01:32 AM

I have setup a table with a number of users
I am now trying to get a login to work but for some reason the password() function
is giving me loads of hassle.

the following is the query being sent to mysql

I have set the user name to username and the password to password just to make life realy easy

SELECT userref FROM users WHERE userid = 'username' AND userpassword = password('password')

if i change it to

SELECT userref FROM users WHERE userid = 'username' AND userpassword = '5d2e19393c'

it works fine so the problem has to be in the encryption

does anyone know of this problem and how to fix it?

I'm completly lost here
The best way to learn
is to ask you lot........

#2 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 16 June 2006 - 07:49 AM

what is the length of the password field in the db? it looks like it's too short AFAIK password() is 41 byte (in mysql 4.1+) and yours is 10 chars
z..z..z..z..z..z..z..z..

#3 thehigherentity

thehigherentity
  • Members
  • PipPipPip
  • Advanced Member
  • 49 posts

Posted 16 June 2006 - 10:23 PM

that explains it then i needed to make the field longer, I only set it to ten lol

userpassword VARCHAR(10) BINARY NOT NULL

thanks a lot its working fine now
The best way to learn
is to ask you lot........




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users