-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFetchUserHealthProfile.php
43 lines (32 loc) · 1.29 KB
/
FetchUserHealthProfile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
$servername = "seekt.asia";
$username = "seektasi_fitness";
$password = "fitness53300";
$dbname = "seektasi_bus";
$con = mysqli_connect($servername, $username, $password, $dbname);
$user_id = $_POST["id"];
$statement = mysqli_prepare($con,"SELECT * FROM Health_Profile WHERE user_id = ?");
mysqli_stmt_bind_param($statement,"s",$user_id);
mysqli_stmt_execute($statement);
mysqli_stmt_store_result($statement);
mysqli_stmt_bind_result($statement,$health_profile_id,$user_id,$weight,$blood_pressure,$resting_heartrate,$arm_girth,$chest_girth,$calf_girth
,$thigh_girth,$waist,$hip,$created_at,$updated);
$health = array();
$record = array();
while(mysqli_stmt_fetch($statement)){
$health["health_profile_id"] = $health_profile_id;
$health["id"] = $user_id;
$health["weight"] = $weight;
$health["blood_pressure"] = $blood_pressure;
$health["resting_heartrate"] = $resting_heartrate;
$health["arm_girth"] = $arm_girth;
$health["chest_girth"] = $chest_girth;
$health["calf_girth"] = $calf_girth;
$health["thigh_girth"] = $thigh_girth;
$health["waist"] = $waist;
$health["hip"] = $hip;
$record[] = $health;
}
echo(json_encode($record));
mysqli_close($con);
?>