Re: SQL Password() function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

Yaswanth Narvaneni wrote:
Hi!

Is there a function (or a code snippet) in PHP for mysql password() function?

I 'dont' want to use something like select * from table where
table.passwd=password($passwd);

Is there any other alternate way to do it?

Try this:

<?php
$mypassword="this is my password!!!";

$query=mysql_query("SELECT PASSWORD('$mypassword')");

list($mysql_pass)=mysql_fetch_array($query);

mysql_free_result($query);unset($query);

printf( "My password is &quot;%s&quot; and Its hash value ".
	"is &quot;%s&quot; computed by the MySQL PASSWORD() function",
	$mypassword, $mysql_pass);

?>

You don't need a MySQL connection.

Happy weekend.

--
Gustavo Narea.
PHP Documentation - Spanish Translation Team.
Valencia, Venezuela.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux