fetchField(); if ($result) { $msg = 'OK'; http_response_code(200); } else { http_response_code(500); $msg = 'NOK'; } exit($msg);