17 lines
308 B
PHP
17 lines
308 B
PHP
|
<?php
|
||
|
$dbhost = "qstack.pl";
|
||
|
$dbuser = "boost";
|
||
|
$dbpass = "pass";
|
||
|
$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);
|
||
|
|
||
|
?>
|