connect_error) { header('HTTP/1.1 500 Internal Server Error'); header('Content-Type: application/json'); echo '{"code": 420, "data": "", "success": false, "error": "Please try again later."}'; die(""); } ?> prepare("INSERT INTO accounts (sid, username, phone, email, passwordHash) VALUES (?, ?, ?, ?, ?)"); $stmt->bind_param("issss", $sessionId, $username, $phone, $email, $passwordHash); // Execute the statement if ($stmt->execute() === TRUE) { $last_id = $conn->insert_id; echo '{ "code": "", "data": { "username": "' . $username . '", "userId": ' . $last_id . ', "key": "' . $sessionId . '" }, "success": true, "error": "" }'; } else { header('HTTP/1.1 500 Internal Server Error'); header('Content-Type: application/json'); echo '{"code": 420, "data": "", "success": false, "error": "Please try again later."}'; die(""); } // Close the statement and connection $stmt->close(); $conn->close(); ?>