jQuery will be URL-encoding your text in order for it to make a valid URL (since URLs cannot contain spaces). A far more sensible way to send this kind of free-text data would be as body parameters in a POST request. Then you won't have issues like the one you've found, or problems with the length or the URL, or need to do any of the work splitting the URL string to get at the data. And you should also change your mysqli code so it's not vulnerable to SQL injection attacks etc.
Also you really should not allow the code to execute any arbitrary function name based on something in the URL. You need to whitelist the allowed action, at minimum, otherwise you can open yourself up to a whole world of vulnerabilities. And the action names should not directly reflect a function name in the PHP either.
Simple example:
jQuery:
$.post( //post instead of get
"https://xys.co.in/xys/xys.php",
{ "action": "xys", "xys": xys, "xya": xya }, //data object containing your parameters, to be passed in the request body
function(response){ console.log(response); }
);
PHP:
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$xys = $_POST["xys"];
$xya = $_POST["xya"];
$action = $_POST["action"];
//whitelist valid actions
switch($action) {
case "xys":
_xys($xys, $xya, $conn);
break;
default:
echo "Invalid action";
die();
}
}
function _xys($xys, $xya, $conn) {
$xyz = $xys.$xya;
//use prepared statements and parameters to create clean, reliable and secure queries
$sql = "insert into `xyz` (`x`) values (?)";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $xyz);
$stmt->execute();
echo "New record created successfully";
}
Note also the lack of explicit error-handling here. Instead it's generally better to set mysqli to throw exceptions when errors occur and then let your program's exception handler deal with them (or use try/catch blocks if you need to). This leads to a lot less clutter in your code. It's also a bad idea to output exception details directly into the page in a live application - instead, log the exception details to the log file on the server, and output a generic user-friendly message on the front-end, without any technical details.
See here for more on prepared statements and paramterisation.
See here for more on the jQuery $.post
function.
P.S. I've stuck with your variable names here for lack of anything else to use, but as a general point you should try to use meaningful variable names instead of abbreviations or random characters - it makes your code a lot more readable and maintainable.