Hi.

On Sun 2002-08-11 at 12:07:47 -0500, [EMAIL PROTECTED] wrote:
> At 9:25 -0700 8/11/02, Michael Collins wrote:
[...]
> >SELECT * FROM MYDB
> >WHERE EmailAddress=$EmailEntered AND 
> >DECODE(LoginPassword,'MySalt')=$PasswordEntered
> 
> If you write the query like that, yes, it will use a complete scan.

I beg to differ. If there is an index on EmailAddress it will be used
and only all entries with the same email address (which should be one
or only one) will be scanned.

> But you could also use
> 
> ... AND LoginPassword = ENCODE($PasswordEntered,'MySalt')

But that's a good idea anyhow. 

Bye,

        Benjamin.

-- 
[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

Reply via email to