On Feb 16, 2008 10:17 PM, Nasreen Laghari <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm junior in PHP and stuck on Encryption.
> I have encrypted password using SQL :
> $query = "insert into user (userid,password,) values 
> ('$username',Password('$pass'));";

    It's a one-way encryption method, so you won't be able to see the
plain-text equivalent of the password again, but you can use this when
testing a login:

    SELECT * FROM user WHERE userid='".$username."' AND

    Also, to correct your $query above, some things to note:
        PASSWORD is a reserved word in MySQL, so you shouldn't name
any columns or databases as such.
        You have a comma after `userid,password,` in your column bracket.
        With PHP, you shouldn't end your MySQL query with a semicolon.
The code needs it to terminate the line, the query doesn't.


Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to