query($sql); $data['id'] = mysqli_insert_id($db); $data['success'] = true; echo json_encode($data); //echo json_encode($data);