I am doing an update statement into my database. My connection has been done properly. However there is an issue. After $conn->
the remaining of my codes are being displayed out just like echo instead of the update statement updating the database. I have been trying to debug it but nothing seems to work. Unsure of the error. Do help to identify the error.
<?php//check on the updating
if (isset($_POST['set'])){
$query = 'UPDATE default SET sql_statement ="'.$_POST['sql'].'", x_axis = "'.$_POST['x'].'", y_axis = "'.$_POST['y'].'" WHERE id = "'.$id.'" ';
$result = $conn->query($query);
if($result){
header('Location:previewgraphs.php?id='.$id);
die();
}
}
?>