26 lines
664 B
PHP
26 lines
664 B
PHP
|
<?php
|
||
|
include('includes/config/config.php');
|
||
|
include('log_entry.php');
|
||
|
$query = "select health_advice_name from health_advice ";
|
||
|
if (!$result = @mysqli_query($conn,$query)) {
|
||
|
exit(mysqli_error($conn));
|
||
|
}
|
||
|
$data = array();
|
||
|
if(mysqli_num_rows($result) > 0) {
|
||
|
while ($row = mysqli_fetch_assoc($result)) {
|
||
|
// error_log("healthadvice:".$row['health_advice_name']);
|
||
|
$data[] = $row['health_advice_name'];
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
$data['status'] = 200;
|
||
|
$data['message'] = "Data not found!";
|
||
|
}
|
||
|
// foreach($data as $d){
|
||
|
// error_log("healthadvice datarow:".$d);
|
||
|
// }
|
||
|
|
||
|
echo json_encode($data);
|
||
|
?>
|