Here is the very basic version :
To store the password in MySQL
$password = md5($password);
mysql_query("INSERT INTO users (password [etc..]) VALUES (password='$password'");
So that way, you store it as the MD5 hash of the password
(which by the way, is 32 bytes long, so make sure your password field is at least 32 chars long)
To see if someone entered the right password, just take their password, md5() it, and compare it to the one in the database.
(That's why it's ONE WAY --- you can't decrypt it. The only thing you can do is compare it)
$name = $_POST['name'];
$entered_password = md5($_POST['password']);
$result = mysql_query("SELECT * FROM users WHERE name='$name' AND password='$entered_password'");
Like that
If you need more help, please feel free to ask!