Forum Moderators: coopster

Message Too Old, No Replies

$query

Question

         

aff_dan

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

10+ Year Member



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

bcolflesh

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

WebmasterWorld Senior Member 10+ Year Member



Try \;

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

aff_dan

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

10+ Year Member



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

mm1220

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

10+ Year Member



bcolflesh meant you to use \;
here: Content-Type: text/html\;
and not at the end of the statement.

aff_dan

11:19 am on Jan 4, 2006 (gmt 0)

10+ Year Member



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

inveni0

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

10+ Year Member



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.