Re: mysql_query problem (more suggestions)
| From: | Brad Wright | Date: | Tue, 17 Jul 2001 05:22:50 +0000 |
| Subject: | Re: mysql_query problem (more suggestions) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-58187@lists.php.net to get a copy of this message | ||
the problem is (as i understand it), the password function is a mySQL
function and not a PHP function, therefor it works in the context of a
mysql_query, but not as a PHP function (which your suggested code calls).
Unless i have actually defined a function 'password()', calling 'echo
password('$password') will (...does, i just double checked) causes a Fatal
Error 'Undefined Function'.
Nice try tho :)
> From: Alvin Tan <alvintan@inscribe.com.my>
> Date: Tue, 17 Jul 2001 13:07:45 +0800
> To: Brad Wright <bradwright@optushome.com.au>
> Subject: Re: [PHP] mysql_query problem (more suggestions)
>
> Then,
>
> how about this:
>
> $pw = password($password);
> $sql = "SELECT * FROM login_table where Pass ='$pw'";
> $testResult = mysql_query($sql) or die ("ouch");
> echo $sql;
>
> this way you can see what sql is talking to the db.
>
> @lvin
>
> At 12:59 PM 7/17/01, you wrote:
>> password('$variable') when used in a mysql_query, uses the mysql function to
>> convert the contents of $variable to an encrypted form for keeping in the
>> database.
>>
>>> From: Alvin Tan <alvintan@inscribe.com.my>
>>> Date: Tue, 17 Jul 2001 12:49:06 +0800
>>> To: Brad Wright <bradwright@optushome.com.au>
>>> Subject: Re: [PHP] mysql_query problem
>>>
>>> Hi Brad,
>>>
>>> Shouldn't it be:
>>>
>>> $testResult = mysql_query("SELECT * FROM login_table where Pass =
>>> '$password'") or die ("ouch");
>>> ^^^^^^^^^^^^^^
>>>
>>> unless you have a function called password() you don't need to use the
>>> $password variable within password('$password')
>>>
>>> HTH,
>>> @lvin
>>>
>>> At 12:48 PM 7/17/01, you wrote:
>>>> $testResult = mysql_query("SELECT * FROM login_table where Pass =
>>>> password('$password')") or die ("ouch");
>>>
>