> 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...

Normally that error indicates a problem with the syntax of your sql query. 
If you add the line 

echo mysql_error();

after your mysql_query line you'll get a useful error message from mysql, 
which should indicate more precisely where your problem lies.

David Robley
Temporary Kiwi!

Quod subigo farinam

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to