I am trying to update a mysql entry.
Getting this error;

Insert Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('loginid='15',title='Test',author='Sorcher',body='
Yeah just testing this aga' at line 1
if ($_GET['edit']){
		$getedit = $_GET['edit'];
		$result=mysql_query("UPDATE articles SET ('loginid='$loginid',title='$title',author='$author',body='$body',date='$today',category='$category') WHERE articleid='$getedit' LIMIT 1")
or die("Insert Error: ".mysql_error());
mysql_close($link);
echo "Success!<br><a href='../article.php'>View the list!</a>";
exit();
}else

Recommended Answers

$result=mysql_query("UPDATE articles SET loginid='$loginid',title='$title',author='$author',body='$body',date='$today',category='$category' WHERE articleid='$getedit' LIMIT 1")

Just use this, you had an extra ) that you didn't need...

Jump to Post

All 2 Replies

$result=mysql_query("UPDATE articles SET loginid='$loginid',title='$title',author='$author',body='$body',date='$today',category='$category' WHERE articleid='$getedit' LIMIT 1")

Just use this, you had an extra ) that you didn't need...

Damn, thanks. Silly me :O

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.