At 9:30 PM -0400 6/16/01, William Wong wrote:
> > >PHP4> mysql_query("select * from user where username='myname' and passwd
>=
>> >password('mypass')");
>>
>> Define "doesn't work". Fails to return rows? PHP generates an error
>>message?
>
>Hi Paul,
>
>Sorry bout that. Yes it doesn't return any rows despite the fact that the
>correct username and password are entered.
>
>The user/pass was entered with the following query:
>
>PHP4> $result = mysql_query("insert into user values ('$username',
>password('$password'), '$email')");
>
>> The statement is therefore equivalent to:
>> select * from user where username='myname'
>
>Oh. I'm trying to implement authentication. So I guess this is quite bad
>:)
>
>I'm still not sure why my original query (with passwd = ) isn't returning
>any rows. Is there something wrong with the syntax?
Looks correct to me. Try running this query from the mysql program
to verify that you're really matching the password of some entry:
mysql> SELECT *, password('mypass') FROM user;
>
>Regards,
>- Will
--
Paul DuBois, [EMAIL PROTECTED]
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php