ESH/get_med_salt_data.php

25 lines
583 B
PHP
Raw Permalink Normal View History

2024-10-23 18:28:06 +05:30
<?php
include('includes/config/config.php');
include('includes/functions.php');
$itemId = $_REQUEST['item_id'];
$data = [];
$query = "select salt_id from item_salt where item_id='" . $itemId . "' ";
error_log("query for salt getting " . $query);
if (!$result = @mysqli_query($conn, $query)) {
error_log("error here " . mysqli_error($conn));
exit(mysqli_error($conn));
} else {
$i = 0;
while ($row = mysqli_fetch_assoc($result)) {
$data[$i++] = $row['salt_id'];
}
}
error_log("str allergy_items " . print_r($data, true));
echo json_encode($data);