I created this script to sync with my android app. If a user will use the app, the only outputs that will be shown is the only shop that is open between some specific times.
This is my php script. I want to initialize the condition here...
require_once('db.php');
$query = "SELECT s_iD, s_name,s_contNo,s_lat,s_long FROM tbl_shop WHERE
s_status='Confirmed' and act_stat='Active'";
$result = mysqli_query($conn,$query);
$arrayResult = array();
while ($row = mysqli_fetch_array($result)){
array_push($arrayResult,array("id"=>$row['s_iD'],"shopName"=>$row['s_name'],"shopContact"=>$row['s_contNo'],"latitude"=>$row['s_lat'],
"longitude"=>$row['s_long']));
}
echo json_encode(array("result"=>$arrayResult));
mysqli_close($conn);
?>
...so that the only output(array) that will be called in the android app is the final result of the condition.
This is table of shop
I'm still a new in php and android, so I don't know what code should I write to make this a possibility.