Jump to content

Recommended Posts

Hey

 

I'm not sure if this it the correct place to post this but if not then feel free to move it. 

 

I've created a mysql table to store user names and password and am trying to create a log in page which checks the username and passwords are valid. 

 

I used this sql to create the table "create table users (first_name varchar(25) not null, last_name varchar(25) not null, username varchar(20) unique, password varchar(16);"

 

However when I try to insert data into the table using "insert into users (first_name, last_name, username, password) values ("jack", "jones", "jack", password("jack"));" it says there is a warning.  It's something to do with the password because when you view the table the password is stored as a 15 character string with a "*" at the start. 

 

Does anyone know what I'm doing wrong?

Link to comment
https://forums.phpfreaks.com/topic/200587-mysql-password-warning/
Share on other sites

The mysql password() function is not supposed to be used by user applications -

 

The PASSWORD() function is used by the authentication system in MySQL Server; you should not use it in your own applications. For that purpose, consider MD5() or SHA1() instead.

 

And if you were using it, it requires 41 characters to store and it apparently does include a leading * -

'*AAB3E285149C0135D51A520E1940DD3263DC008C'

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.