Welcome to WebmasterWorld Guest from 54.224.86.148

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

$query

Question

     
9:13 pm on Jan 3, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:May 11, 2004
posts:133
votes: 0


Hello Sirs,

My php code is like:

$query = 'update wp_posts set post_content=REPLACE(post_content,"Content-Transfer-Encoding: 7bit","Sponsored by")';
$query = 'update wp_posts set post_content=REPLACE(post_content,"Content-Type: text/html; charset=us-ascii","New")';

It is ok ; after the second row? This code doesnt work, maybe is due to ;?

Regards,
Dan

9:19 pm on Jan 3, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 21, 2003
posts:2355
votes: 0


Try \;

Use a backslash to escape any control characters/delimiters in your statement.

9:58 pm on Jan 3, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:May 11, 2004
posts:133
votes: 0


Hi bcolflesh,

I got this errror:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/mediapr/public_html/news/update.php on line 13
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/mediapr/public_html/news/update.php on line 14

$query = 'update wp_posts set post_content=REPLACE(post_content,"PR","RE")'\;
$query = 'update wp_posts set post_content=REPLACE(post_content,"CANNT","MOVE")'\;

Why the script can not make step by step?

IF I will leave:
$query = 'update wp_posts set post_content=REPLACE(post_content,"PR","RE")';

Will works, but if I will add:

$query = 'update wp_posts set post_content=REPLACE(post_content,"PR","RE")';
$query = 'update wp_posts set post_content=REPLACE(post_content,"CANNT","MOVE")';

I mean two queries, then will not work.
WHY?

Regards,
Dan

11:04 pm on Jan 3, 2006 (gmt 0)

Full Member

10+ Year Member

joined:Sept 13, 2003
posts:214
votes: 0


bcolflesh meant you to use \;
here: Content-Type: text/html\;
and not at the end of the statement.
11:19 am on Jan 4, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:May 11, 2004
posts:133
votes: 0


Hi,

I have this:

$query = 'update wp_posts set post_content=REPLACE(post_content,"<META http-equiv"Content-Type" content"text/html; charsetUTF-8"><br />","")';

It doesnt change from datbase, where is wrong? Where to add \

Regards,
Dan

1:56 pm on Jan 4, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 22, 2005
posts:388
votes: 0


Try This:

$query = 'update wp_posts set post_content=REPLACE(post_content,"Content-Transfer-Encoding: 7bit","Sponsored by")';
$query = 'update wp_posts set post_content=REPLACE(post_content,"Content-Type: text/html\; charset=us-ascii","New")';

I think this is what they meant.