homepage Welcome to WebmasterWorld Guest from 54.163.72.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Update Database articles
update
aff_dan




msg:1269349
 5:33 pm on Jan 3, 2006 (gmt 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]

 

islandlizard




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

change:

mysql_query($query);

to

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

and see what happens.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved