> > towns = '$town'
> > ...and...
> > towns LIKE '$town'
> >
> > ...are essentially the same without the % wildcard character. Thus,
> >
> > towns = '$town'
> > ...is much different than...
> > towns LIKE '%$town%'
>
> How different are they? I'm not even sure what a wildcard is....?
A wildcard is a character that can be used to represent any character (or
any set of any character). For instance, on many operating systems the *
wildcard represents what you could call "anything". So * is anything from
the empty string ('') to anything ('Toby Butzon'). '*zon', however, would
match only strings ending in 'zon'; thus, 'Toby Butzon' would match but
'Joe Smith' would not.
In SQL, the % symbol is used as the * wildcard.
Consider the following:
(id) bases
-------------
(1) Ft. Worth
(2) Ft. Benning
Here are some queries of the above table with their results....
bases='Ft. Worth' returns record 1
bases LIKE '%Worth%' returns record 1
bases LIKE '%Ft.%' returns 1 & 2
bases LIKE '%' returns all records (in this case, 1 & 2)
See?
> And thanks ;)
Of course.
--Toby
--
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]