Replacing * with %
| From: | Markus Lervik | Date: | Tue, 15 Jan 2002 09:40:05 +0000 |
| Subject: | Replacing * with % | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-15811@lists.php.net to get a copy of this message | ||
Hello all!
I can't for the love of god get neither ereg_replace nor str_replace
to work. I wan't to replace * with % so I can use SELECT ... WHERE
whatever LIKE "string%" in MySQL.
I've tried ereg_replace("*","%",$search_name). Didn't work.
I tried escaping the asterisk. I tried double-escaping the asterisk.
I tried str_replace("*","%",$search_name), and that didn't work
either. I tried just about everything I could think of, escaping, double-
escaping and triple-escaping ad nauseum, but it just wont work.
Oh, yes, I also tried $search_name=ereg_replace(blablabla);
What a surprise. It didn't work.
Yes, I've RTFM, RTMFM, read from my PHP Blackbook to phpbuilder.net
and just about everything in between.
Pretty soon I'll start bashing away on that Solaris 8 box over there.
Markus - frustrated
--
Markus Lervik
Linux-administrator with a kungfoo grip
Vaasa City Library - Regional Library
markus.lervik@vaasa.fi
+358-6-325 3589 / +358-40-832 6709