Wild guess but does the original WHILE AND have two spaces between the WHILE and the AND? us an echo before and after and count the number of spaces. But yes it would be possible to avoid this with the judicious appearance of an if statement.
Chris Payne wrote:
Sorry if this already went through, my SMTP server was having problems.
Hi there everyone,
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);
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 would appreciate any help on this, as it’s very important.
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php