$strs = mysqli_query($conn, "SELECT * FROM `table` WHERE `id` >= '$begin' AND `id` <= '$end'");
$("#get").click(function() {
$.ajax({
method: 'get',
url: 'script.php',
success: function(result) {
console.log(result);
},
error: function(xhr) {
alert(`Error ${xhr.status} error text ${xhr.statusText}`);
},
});
});