Learning PHP and MySQL

Example 13-7 Creating the entry in the database for a user with an encrypted password

INSERT  INTO  users  (`first_name`,  `last_name`,  `username`,  `password`) VALUES
('Michele','Davis',  'mdavis',  MD5('secret'));

Yields:

Query  OK,  1  row  affected  (0.01  sec)

To check that your row was created and see what the MD5 encoding function returned, you query the users table:

SELECT  *  FROM  users;

Posted by on 09/25 at 11:29 AM

Next entry: Example 13-8 The database login details

Previous entry: Example 13-6 Creating the users table to store login information

<< Back to main