PHP Ajax Mysql Easy Example
PHP Ajax Mysql Easy Example
----------------------------------
USE testdb;
);
-----------------------------------------
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script>
function loadUser() {
xhttp.onreadystatechange = function() {
};
xhttp.send();
</script>
</head>
<body>
<div id="user"></div>
</body>
</html>
----------------------------------------
<?php
// fetch_user.php
if ($conn->connect_error) {
if ($row = $result->fetch_assoc()) {
echo $row["name"];
} else {
$conn->close();
?>
Summary: