I think you want the wildcard characters, % and
_, to be within the variable, not within the variable name. For example, if you
are looking for all advertisers whose name begins with 'A' followed by zero or
more unknown characters, you would set your variable equal to this pattern [I
don't know PHP so if this isn't how a variable declaration would look in PHP,
adjust it so it does]:
myVar = 'A%'
Then, you would execute your query, plugging in
the variable in the appropriate place [again, I don't know PHP so maybe you need
a $myVar instead of :myVar or at least something along those
lines]:
select *
from mytable
where advertiser =
:myVar
In your question, you seem to want to put the
wildcard character(s) in the variable name like this:
select *
from mytable
where advertiser = %
:myVar
While this might conceivably work in some
programming languages, it's not the way it is normally done in any language I
know.
Rhino
|
No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.0 - Release Date: 29/04/2005
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]