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 'WHERE id = ''' at line 7
Voor de volledigheid hieronder het stuk script waar het omgaat.
<?php
elseif (!empty($_POST)) {
$query = "
Update serie1
SET
titel = '" . $_POST['titel'] . "',
poster = '" . $_POST['poster'] . "',
email = '" . $_POST['email'] . "',
bericht = '" . $_POST['bericht'] . "',
WHERE id = '" . $_GET['id'] . "'
";
$res = mysql_query($query) or die (mysql_error());
$row = mysql_fetch_assoc ($res);
header('Location: serie 1 overzicht.php');
exit;
}
else
{
?>
<html>
<head>
<title>Verander bericht</title>
</head>
<body>
<?
$sql = "
SELECT id, titel, poster, email, bericht
FROM serie1
WHERE id = '" . $_GET['id'] . "'
LIMIT 0,1
";
if (!($res = mysql_query ($sql))) {
trigger_error (mysql_error ());
}
else {
$row = mysql_fetch_assoc ($res);
$row['bericht'] = nl2br ($row['bericht']);
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Titel:<BR />
<TEXTAREA NAME="titel" COLS="60" ROWS="1"><?php echo $row['titel']?></TEXTAREA><BR />
Poster:<BR />
<TEXTAREA NAME="poster" COLS="60" ROWS="1"><?php echo $row['poster']?></TEXTAREA><BR />
Email:<BR />
<TEXTAREA NAME="email" COLS="60" ROWS="1"><?php echo $row['email']?></TEXTAREA><BR />
Bericht: <BR />
<TEXTAREA NAME="bericht" COLS="60" ROWS="10"><?php echo $row['bericht']?></TEXTAREA><BR />
<INPUT TYPE="submit" NAME="submit" VALUE="verstuur"></INPUT>
</body>
</html>
Heeft iemand een idee? Bij voorbaat dank!