mirror of
https://github.com/serialexperiments0815/SerialsEnforcingInterface.git
synced 2026-07-12 15:32:29 +00:00
28 lines
No EOL
661 B
PHP
28 lines
No EOL
661 B
PHP
<?php
|
|
include('database_connection.txt');
|
|
header("Content-Type: application/json; charset=utf-8");
|
|
|
|
$conn = mysqli_connect($host, $user, $password, $db);
|
|
|
|
if(!$conn){
|
|
http_response_code(500);
|
|
echo json_encode(["error" => "Database connection failed: " . mysqli_connect_error()]);
|
|
exit;
|
|
}
|
|
|
|
$result = $conn->query("select * from person_summary");
|
|
$rows = [];
|
|
|
|
while($row = $result->fetch_assoc()){
|
|
$rows[] = $row;
|
|
}
|
|
|
|
echo json_encode($rows);
|
|
$conn->close();
|
|
|
|
/*
|
|
$query = "select * from person_summary";
|
|
$result = mysqli_query($conn, $query) or die("query has failed");
|
|
*/
|
|
|
|
?>
|