Use this:

$result = mysql_query("SELECT PASSWORD(" . $_POST['password'] . ")");
$password = mysql_result($result,0);

or just use mysql_fetch_row() or AS in your query so you don't have to
recreate that complex column name.

---John Holmes...

> -----Original Message-----
> From: Murat Ö. [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, September 22, 2002 9:33 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] mysql password function
> 
> hi,
> i want to encode a string that users enter with mysql password
function.
> but
> sometimes this code works sometimes don't. mysql warns me:
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
> result
> resource in ........
> 
> the code is:
> 
> $result=mysql_query("select password(".$_POST['password'].")");
>   while ($p = mysql_fetch_array($result, MYSQL_ASSOC)):
>   $pswrd=$p['password('.$_POST['password'].')'];
>   endwhile;
> 
> thanks...
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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

Reply via email to