Re: password function
| From: | David Robley | Date: | Tue, 24 Sep 2002 04:33:29 +0000 |
| Subject: | Re: password function | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21952@lists.php.net to get a copy of this message | ||
In article <20020922122624.78413.qmail@pb1.pair.com>, murat_inf@yahoo.com
says...
> 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