connect_error) { http_response_code(500); die("database connection failed. ".$warning); // . $conn->connect_error); } $stmt = $conn->prepare("INSERT INTO error_reports (msg, url, line, column, obj, ua, app_version, previous_commit, ip) VALUES". "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); $stmt->bind_param("ssiisssss", $_REQUEST["error"]["msg"], $_REQUEST["error"]["url"], $_REQUEST["error"]["line"], $_REQUEST["error"]["column"], $_REQUEST["error"]["obj"], $_REQUEST["client"]["ua"], $_REQUEST["client"]["app_version"], $_REQUEST["client"]["previous_commit"], $_SERVER["REMOTE_ADDR"]); $stmt->execute(); $stmt->close(); $conn->close(); exit("report saved. ".$warning); ?>