WebServ/www/public/M6/05/index.php

12 lines
276 B
PHP
Raw Normal View History

2024-09-24 13:06:22 +00:00
<?php
include_once('../inc/world_connect.php');
$stmt = $db->prepare("SELECT Name, Population, Code FROM country");
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
header('Content-Type: application/json');
echo json_encode($result, JSON_UNESCAPED_UNICODE);