Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jordanste

macrumors member
Original poster
Feb 25, 2006
83
0
I am trying to create an "edit article" page and while im not exprecienced with sql i assumed this query would work, i get a successful query message but the row isnt actually updated in my database table, is there a syntax error with this query or does that look alright?

Code:
$query="UPDATE `main` SET `title`='$title', `body`='$body', WHERE `id`='$articleid'";
mysql_query($query) or die('<p>Error, update query failed</p>');
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.