Re: How to use Password() in PHP? Syntax problem?



karlarneg@xxxxxxxxx wrote:
Hello again.
I have tried to use password() in my login-script but it did not work.

My code is:

$sql = "SELECT * FROM users";
$sql .= " WHERE username ='" .
mysql_real_escape_string($_POST['username']) . "' ";
$sql .= " AND pwd = (PASSWORD( ' " . $_POST['pwd'] . " ' )) ";

What is wrong in this?
And how should I write it?

Thanks for all help!

Karl


Karl,

A bigger question is - why are you storing web users in the MySQL user table? That should be only for MySQL users - and your website users should never have MySQL user id's.



--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================

.