prepare($sql); $result->bind_param("s", $plaka); $result->execute(); $result = $result->get_result(); } else { echo json_encode(["success" => "false", "message" => "param error"]); die(); } } if (!$result) { echo json_encode(["success" => "false", "message" => "server error"]); die(); } $resultarray = array(); while ($row = $result->fetch_assoc()) { array_push($resultarray, $row); } $bulunans = $result->num_rows; if ($bulunans < 1) { echo json_encode(["success" => "false", "message" => "not found"]); die(); } echo json_encode(["success" => "true", "number" => $bulunans, "data" => $resultarray]); :) die(); } else { echo json_encode(["success" => "false", "message" => "request error"]); die(); }