Welcome to WebmasterWorld Guest from 54.159.71.232

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Update Database articles

update

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

Junior Member

10+ Year Member

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


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]

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

Junior Member

10+ Year Member

joined:Oct 13, 2005
posts:41
votes: 0


change:

mysql_query($query);

to

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

and see what happens.