Welcome to WebmasterWorld Guest from 54.226.147.190

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Update Database articles

update

     

aff_dan

5:33 pm on Jan 3, 2006 (gmt 0)

10+ Year Member



Hi Sirs,

I have this code in update.php:

<?
$id=$_GET['post_content'];
$username="username";
$password="password";
$database="mydb";
mysql_connect(localhost,$username,$password);

$query='update wp_posts set post_content=REPLACE(post_content,"Ezine","Articles")';
mysql_query($query);
echo "Record Updated";
mysql_close();
?>

I have error:

Parse error: parse error, unexpected T_STRING in /home/blueairn/public_html/update.php on line 9

this is mysql_query($query);

Where is wrong? Why doesnt update ezine text with articles text from that database?

Regards,
Dan

[edited by: jatar_k at 6:35 pm (utc) on Jan. 3, 2006]
[edit reason] generalized user/pass [/edit]

islandlizard

4:31 am on Jan 4, 2006 (gmt 0)

5+ Year Member



change:

mysql_query($query);

to

$result=mysql_query($query)or die("There was an error: ".mysql_error())

and see what happens.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month