Hi Brad,
Took another go at it:
This works for me:
$sql= "SELECT * FROM login_table where Pass = password('$password')";
$testResult = mysql_query($sql) or die ("ouch");
$b = mysql_num_rows($testResult);
echo $b;
for sure. I password(ed) the INSERT and it shows the encrypted version in
the table, then i created another form and this works! I get the num_rows...
@lvin
btw, check you caps again, both your code had different spellings:
Login_Table and login_table....
At 03:08 PM 7/17/01, Brad Wright wrote:
>Alvin,
>the values for Pass in the table have been passed into the table using the
>password('') command and I have also veiwed he content of the tables to
>confirm it. IE the value (i've only got one row in the table at the moment)
>I have passed to the table IS encrypted.
>this is the insert command:
>$query = "insert INTO Login_Table(Login,Pass)
> values ('$Login', password('$Pass'))";
>
>The most puzzling thig is that this works, but the use of the same (mySQL)
>password function, in the SELECT statement doesnt work.
>
>
>AAAAHHHH
>
> > From: Alvin Tan <[EMAIL PROTECTED]>
> > Date: Tue, 17 Jul 2001 14:38:58 +0800
> > To: Brad Wright <[EMAIL PROTECTED]>, Jason Murray
> > <[EMAIL PROTECTED]>, PHP General List
> > <[EMAIL PROTECTED]>
> > Subject: Re: [PHP] mysql_query problem (more suggestions)
> >
> > Hi again,
> >
> > Just a long shot: since password() encrypts the password that's passed
> > through it, how did the original password get in to db anyway? Was it
> > encrypted too? Cause if the password in the db is plain text and the user
> > submits a plain text in a form called $password, the password() function
> > WILL encrypt the form input and there will be no matches.
> >
> > try removing the password() function in the sql query and substitute it for
> > $password only. If there is a match, then we know we need to put in the db
> > an INSERT statement with password()..
> >
> > @lvin
> >
> > At 01:57 PM 7/17/01, Brad Wright wrote:
> >> Jason,
> >> I have tried what yoiu suggested. result is the same.
> >>
> >>> From: Jason Murray <[EMAIL PROTECTED]>
> >>> Date: Tue, 17 Jul 2001 15:28:11 +1000
> >>> To: "'Brad Wright'" <[EMAIL PROTECTED]>, Alvin Tan
> >>> <[EMAIL PROTECTED]>, PHP General List <[EMAIL PROTECTED]>
> >>> Subject: RE: [PHP] mysql_query problem (more suggestions)
> >>>
> >>>> 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 :)
> >>>
> >>> the original mail said to echo $query, which will include some
> >>> text in it that says "password('ifovhfoiuf')" ... you should
> >>> then paste that entire query into your MySQL interpreter and
> >>> see what the reaction is instead of trying to secondguess it :)
> >>>
> >>> Jason
> >>>
> >>> --
> >>> PHP General Mailing List (http://www.php.net/)
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >>>
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]