ik heb een vraagje over updaten in mysql. als ik dit doe:

$sql2 = "UPDATE news SET
title = $title1,
content = $content,
author = $author,
published = $published
WHERE id = $id";

mysql_query($sql2) or die(mysql_error());

dan zegt ie:
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 ' content =

Wat kan ik hieraan doen zodat het wel werkt?
Er moeten enkele quotes om je vars.

edit: behalve bij $id
dus:

$sql2 = "UPDATE news SET
title = '$title',
content = '$content',
author = '$author',
published = '$published'
WHERE id = $id";

mysql_query($sql2) or die(mysql_error());
?
Oki, thanks, het werkt :)

Reageren