I have this code and I want to get the info in medication table
and display it where acc_id
in account table
is =
to acc_id
in medication table
and where med_timeoftheday='morning'
$postdata = file_get_contents("php://input");
if (isset($postdata)) {
$request = json_decode($postdata);
$User_ID = $request->acccid;
$sql = sprintf("SELECT * FROM account_info
join medication on account_info.acc_id = medication.acc_id
where account_info.acc_id='%s'",
mysqli_real_escape_string($conn,$User_ID));
$result=$conn->query($sql);
if ($result->num_rows>0)
{
while($row=$result->fetch_assoc())
{$data[]=$row;
}
echo json_encode($data);
}
}
this is my ts :
how can I do that ?
Thank you in advance!