...

View Full Version : I cannot get this STR_REPLACE to work



ruffy
07-23-2008, 10:51 PM
How do I modify the Mysql query string in PHP for the following
str_replace function?
I don't know how to do it.

$query = str_replace("WHERE","WHERE prospectid > \"$prospectID\" AND",$query);

Webmonkey
07-23-2008, 11:09 PM
Hmm, Not sure why it might not work, unless the variables are colliding.


$query1 = str_replace("WHERE", "WHERE `prospectid` > {$prospectID} AND", $query);

let me know if you are having any more problems!

The only other thing I can think of is the case of the text, in which case use str_ireplace (case insesitive version).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum