List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:June 17 2001 2:11am
Subject:Re: Strange Mysql behaviour
View as plain text  
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, paul@stripped
Thread
Strange Mysql behaviourWilliam Wong17 Jun
  • Re: Strange Mysql behaviourPaul DuBois17 Jun
  • Re: Strange Mysql behaviourWilliam Wong17 Jun
    • Re: Strange Mysql behaviourPaul DuBois17 Jun
  • Re: Strange Mysql behaviourSDiZ Cheng17 Jun
  • Re: Strange Mysql behaviourWilliam Wong17 Jun