Insert / Update Encrypted Password
I need to build a new log-in system based on existing users. The issue I have is that I have three sections of our website that require a log-in and I have three different user tables. As some of the users have access to one or more sections, they have to log-in to each section separately. I would like to create just one table that manages all the passwords for all of the sections. I assume I can join the tables via the e-mail address field.
So I have created a new table that is already populated with existing user data.
If I add a new user, or update an existing user how do I add a new encrypted password - for example to the following insert code?
And, is there an advantage to use "crypt" instead or "hash" to encrypt the password?
$InsertQuery->bindColumn("new_password", "s", "".((isset($_POST["new_password"]))?$_POST["new_password"]:"") ."", "WA_DEFAULT");
Thanks