You are here: Re: SQL Password() function « PHP « IT news, forums, messages
Re: SQL Password() function

Posted by Gustavo Narea on 11/26/05 19:47

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация