<html>
<head>
<title>Question update</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<? // First part of script time script ?>
<?PHP include("../includes/exetime1.php"); ?>
<body>
<?PHP
//Connect to MySql
include("../includes/connect.php");
//Select Database
include("../includes/dbselect.php");
// Set ID variable from the GET URL
$answer = $_POST['answer'];
$updatequestion = @mysql_query("UPDATE search SET answer='$answer' answered=1 WHERE id'=$id'");
echo ('Question answered<P>');
?>
<?PHP // Second part of script time script ?>
<?PHP include("../includes/exetime2.php"); ?>
</body>
</html>
<html>
<head>
<title>Question update</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<? // First part of script time script ?>
<?PHP include("../includes/exetime1.php"); ?>
<body>
<?PHP
//Connect to MySql
include("../includes/connect.php");
//Select Database
include("../includes/dbselect.php");
// Set ID variable from the GET URL
$answer = $_POST['answer'];
$id = $_POST['id'];
answered = ('1');
$updatequestion = @mysql_query("UPDATE search SET (answer, answered) VALUES ($answer, $answered) WHERE id = '$id'");
echo ('Question answered<P>');
?>
<?PHP // Second part of script time script ?>
<?PHP include("../includes/exetime2.php"); ?>
</body>
</html>
$sql = "UPDATE search SET answer='$answer', answered='$answered' WHERE id = '$id'";
@$updatequestion = mysql_query($sql) or die(mysql_error().'<p>'.$sql.'</p>');
<?php
UPDATE search SET answer='{$answer}', answered= '{$answered}'
WHERE .....
is better for you to include the string values between {}, also if you have a numeric value you will have to use just {} without quote, like
answer={$answer}
?>