<button></button>
if(!$result) {
die('Query failed' . mysqli_error());
}
?success: function() {
alert("Message send!");
},
success: function(data) { alert(data); }
_
(там вместо mysql пишется mysqli). <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js" integrity="sha256-3Jy/GbSLrg0o9y5Z5n1uw0qxZECH7C6OQpVBgNFYa0g=" crossorigin="anonymous"></script>