Problem with password function



I want to use password function which allow me to encrypt the password.
But the problem comes with this message:

Fatal error: Call to undefined function: password()

How can I solve this problem please ?
you are better to use the md5() function for encrypting passwords.

There is no password() function in PHP. There is, however, an md5() function as bezmond suggest, and you should use that instead.
I think you are misunderstanding MySQL and PHP functions...
Okay, I have used md5 to encrypt the password. The piece of code that I am talking about is here:
//$name is the user name and $password represent the password
		//querythe database to see if there is a record which matches
		$query=" select count(*) from auth where
		name='$name' and  
		password='$temp2'  ";

		 echo 'Cannot run query';


	    //visitor's name and password combination are correct
		echo" you have signed in correctly";

but $count is always equal to 0. So the password always is not correct. I tried displaying the password which I entered in the login form by writing
and it was 243e61e9410a9f577d2d662c67025ee9. while it stored as: e10adc3949ba5 in the database. surely I have used md5 in MySQL also.

MySQL has both PASSWORD() and MD5() functions. They do not do the same things.

But the trouble, I'm guessing, is that you're using one of the MySQL functions, and expecting it to match the output from one of the PHP functions. Either you need to use md5() in PHP exclusively, or one of the above functions in MySQL exclusively. Do not mix and match.
swirlee, Thank you.
But What Can I do ?? How can I compare the encrypted password that has been stored in the Database with the plain password entered in the login page by the user only if I encrypt it ??
Can you tell me about some way to encryt the passwords in the database while the user use the plain password?? if this is can't be done plz tell me about another way.
md5 and the mysql password are one way encryption so in the mysql query when you insert it into the db use

$query = 'insert into `users` (`username`,`password`) values ("'.$_POST['username'].'",PASSWORD("'.$_POST['password'].'"))';

then to check if they entered the correct password use
$query = 'select `user_id` from `users` where `username` = "'.$_POST['username'].'" and `password` = PASSWORD("'.$_POST['password'].'") limit 1';

then do a mysql_num_rows($result) if it returns 1 the password was correct. If 0 then it was wrong.
Thank you Redcircle. I will try it and inform you by the resuilts.