projecte_ionic/src/backend/read.php

14 lines
264 B
PHP
Executable file

<?php
include "config.php";
$sqlString = "SELECT * FROM cs_countries";
$sth = mysqli_query($con, $sqlString);
$output = array();
while ($row = mysqli_fetch_assoc($sth)) {
$output[] = $row;
}
echo json_encode($output);
?>