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



Jerry Stuckle wrote:
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.




Who said he is using the MySQL users table? It's not because his users
table is also called users he is mixing it with the MySQL users table.

--
Jensen Somers <http://jsomers.eu>
Email: -http:// +jensen@

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe trying to
produce bigger and better idiots. So far, the Universe is winning."
- Rick Cook, The Wizardry Compiled
.



Relevant Pages

  • Re: 2 different numbers.....
    ... because if i do seven columns, the textbox wouldn't dispalyed numbers and cliicking several button again...limited to 2. ... Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: 2 different numbers.....
    ... Peter Proost wrote: ... Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Datagrid allow edit in column when its new row
    ... bigger and better idiots. ... So far, the Universe is winning. ... > Greetz Peter ... > bigger and better idiot-proof programs, and the Universe trying to produce ...
    (microsoft.public.dotnet.languages.vb)
  • [Full-disclosure] Moderated?
    ... >bigger and better idiot-proof programs, and the Universe trying to produce ... >bigger and better idiots. ... So far, the Universe is winning." ... such viruses. ...
    (Full-Disclosure)
  • Re: saved bitmap size
    ... to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. ... So far, the Universe is winning. ... striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. ... Dim i As Integer ...
    (microsoft.public.dotnet.languages.vb)