parent
47816715f5
commit
8ae1e1089c
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
$mysqli = new mysqli("localhost", "root", "", "makeittrue");
|
||||
if($mysqli->connect_error) {
|
||||
exit('Could not connect');
|
||||
}
|
||||
|
||||
$sql = "SELECT pseudo, score, id FROM score";
|
||||
|
||||
$stmt = $mysqli->prepare($sql);
|
||||
$stmt->execute();
|
||||
$stmt->store_result();
|
||||
$stmt->bind_result($pseudo, $score, $id);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
echo "<table>";
|
||||
echo "<tr>";
|
||||
echo "<th>CustomerID</th>";
|
||||
echo "<td>" . $pseudo . "</td>";
|
||||
echo "<th>CompanyName</th>";
|
||||
echo "<td>" . $score . "</td>";
|
||||
echo "<th>ContactName</th>";
|
||||
echo "<td>" . $id . "</td>";
|
||||
echo "</table>";
|
||||
?>
|
@ -0,0 +1,11 @@
|
||||
function getTest() {
|
||||
var xhttp;
|
||||
xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
document.getElementById("txtHint").innerHTML = this.responseText;
|
||||
}
|
||||
};
|
||||
xhttp.open("GET", "../database/insert.php", true);
|
||||
xhttp.send();
|
||||
}
|
Loading…
Reference in new issue