I am trying to create a website that will introduce a person and their rating, but behind a password protected wall I can increase or decrease the score. I can make the button respond to ajax , but I cannot pass it to php and have php . strong> answer sql .
Ajax
<script>
$(document).ready(function () {
$('#next').click(function (e) {
e.preventDefault();
$.ajax({
type: "GET",
url: "a1.php",
dataType: "html",
success: function (msg) {
if (msg.success) {
$("#responsecontainer").html(msg);
} else {
alert("error");
}
}
});
});
});
</script>
Honestly, I spent so much time on this problem with ajax flipping. I donβt even think I can understand what I was trying to do at this stage ... Sorry guys.
Php
<?php
$servername = "localhost";
$username = "test_db_usr";
$password = "123";
$dbname = "test_db";
$conn = new mysqli($servername, $username, $password, $dbname);
$sql = "SELECT id, name, points FROM points";
$conn->close();
?>
, - " " MySQL. , PHP, , - !
, , , , ... .
, . Ill , , .
.