Compare commits

...

No commits in common. "piotrb" and "konradm" have entirely different histories.

4 changed files with 1 additions and 36 deletions

View File

@ -1,7 +0,0 @@
const url = "http://localhost/15.05/get.php"
fetch( url + 'get.php')
.then(response => response.json())
.then( data => {
console.log(data)
})

16
get.php
View File

@ -1,16 +0,0 @@
<?
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "";
$dbname = "osoby";
$conn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);
$ans = mysqli_query($conn, "SELECT * FROM osoby");
$json = array();
while ($row = mysqli_fetch_assoc($ans)) {
$json[] = $row;
}
echo json_encode($json);
?>

View File

@ -1,13 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script src="fetch.js"></script>
</body>
</html>

1
token Normal file
View File

@ -0,0 +1 @@
d32d5b217357d3fd81ed4752dec6cc5fe8d76e46