On Thursday 06 January 2005 09:38, Chris Payne wrote: > Iâm having a weird problem and Iâm not sure why, if I try to replace WHERE > AND with just WHERE it wonât do it, but if I try to replace WHERE or AND by > themselves it WILL do it, but I cannot replace BOTH of them from a single > string, is something wrong below? > > $additionalsql = str_replace("WHERE AND", "WHERE", $additionalsql); The code looks OK. Most likely that $additionalsql DOES NOT contain what you think it contains -- check case, check space. > Basically Iâm trying to replace WHERE AND with just WHERE as Iâm building a > very complex SQL query and itâs a difficult one, and I have a solution that > works perfectly but I need this to work in order to do it. I'm pretty sure a simple if-clause somewhere would prevent the extraneous AND from appearing in $additionalsql. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db ------------------------------------------ New Year Resolution: Ignore top posted posts -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php