David Di Biase wrote:
WHERE B.Name LIKE '% . $db-quote($_GET['name']) . %' OR B.Description
LIKE '% . $db-quote($_GET['description']) . %'
Here's how I would do this:
$select-where('B.Name LIKE ?', '%' . $_GET['name'] . '%')
$select-orWhere('B.Description LIKE ?', '%' .
lol, yeah as I was reading your post I basically slammed my hand onto my
forehead and yelped doh!. Yeah, that seems like a no-brainer solution.
LOL. Oh man.
In response to Bill's suggestion, the fields aren't that big. I am indeed
using MyISAM and plan to index it using FULLTEXT.
Thanks,
-
Won't this escape the wildcard character, and offer it as a literal?
enportugal wrote:
HI,
Put the % signal inside the quote funciton
Like this
WHERE B.Name LIKE . $db-quote('%'.$_GET['name'].'%') .
Regards,
David Di Biase wrote:
Hi there,
I was wondering how it might be possible
Bill Karwin wrote:
Jason Webster wrote:
Won't this escape the wildcard character, and offer it as a literal?
Nope. The quote() function only quotes things that may terminate the string
literal, such as ', , \0, etc.
You can try it yourself to be sure:
print
Jason Webster wrote:
That's not necessary. I believe you. I was more curious if it would,
rather than attempting to point out an error.
:-) Well, *I* sometimes don't believe me, so it's usually worth doing a
quick experiment to be sure.
Trust but verify!
Regards,
Bill Karwin
--
View