[thelist] SQL question

rudy r937 at interlog.com
Wed Jan 22 14:46:00 CST 2003


> > also, your variable $searchname contains the appropriate wildcards,
> > right?
>
> Yes, it will be a first or last name of a man or a woman.

okay, but if $searchname does not contain the appropriate wildcard
characters for your database, you might as well use an equality test for an
exact match instead of LIKE

e.g.  LIKE 'John%' will find both 'John' and 'Johnny'

what i meant was, presumably you are appending the wildcards to whatever the
user entered, before substituting the value of $searchname into the sql

> Do I need to use DISTINCT in case I have 2 men whose first name is George?

nope


rudy




More information about the thelist mailing list