password function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bxm_3
Forum Newbie
Posts: 13
Joined: Sun Nov 20, 2005 6:23 pm

password function

Post by bxm_3 »

When I insert the password using the password function.


E.g
password($PASSWORD) I just get the sql not executing, while if I insert using
password($PASSWORD) what is inserted is password($PASSWORD) .

When I browse the table contents I see the password field as password($PASSWORD).

If I try an output the function using password($PASSWORD) I get the error.



Fatal error: Call to undefined function: password() in /content/StartupHostPlus/o/l/olol.org.uk/web/insert_registration.php on line 89

I thought the password function was suppose to insert the password in the format 6a55tggg222555ggg
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

There is no password() function in PHP.
Try crypt()
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

password() is a MySQL function. It's used like this:

Code: Select all

INSERT
INTO
    my_users
    (username,
     password)
VALUES
    ('joe',
     password('joespassword'))
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply