$action = isset( $_POST['action'] ) ? $_POST['action'] : "";
if($action == "update"){
$query = "UPDATE students
set
first_name = '".$mysqli->real_escape_string($_POST['first_name'])."',
last_name = '".$mysqli->real_escape_string($_POST['last_name'])."',
year = '".$mysqli->real_escape_string($_POST['year'])."',
course = '".$mysqli->real_escape_string($_POST['course'])."',
subjects = '".$mysqli->real_escape_string($_POST['subjects'])."'
where id='".$mysqli->real_escape_string($_REQUEST['id'])."'";
if( $mysqli->query($query) ) {
echo "User was updated.";
}else{
echo "Database Error: Unable to update record.";
}
}
it work :3 but i cant see the difference of the codes i mean what happened, im just restart my laptop and then update.