-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmyOrder.php
More file actions
50 lines (40 loc) · 1.48 KB
/
myOrder.php
File metadata and controls
50 lines (40 loc) · 1.48 KB
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
44
45
46
47
48
49
50
<?php
require_once("constants.php");
require_once("checkSession.php");
$link=mysqli_connect("localhost", $DB_USER, $DB_PASSWORD, $DATABASE);
if (mysqli_connect_errno($link))
{
die("connect to db error");
}
mysqli_query($link, "SET NAMES UTF8");
$mail = $_GET['mail'];
$sql="select * from record where mail='".$mail."' order by create_time desc";
$result = mysqli_query($link, $sql);
$num_rows = mysqli_num_rows($result);
if($num_rows <= 0){
$arr = array ('result'=>"OK", 'number'=>0);
echo json_encode($arr);
}else{
$members = array();
while($row = mysqli_fetch_array($result)){
$orderID=$row['orderID'];
$status=$row['status'];
$name=$row['name'];
$cost=$row['cost'];
$family_name=$row['family_name'];
$last_name=$row['last_name'];
$remark=$row['remark'];
$birth=$row['birth'];
$sex=$row['sex'];
$create_time=$row['create_time'];
$notify_time = $row['notify_time'];
$wuxing = $row['wuxing'];
$arr = array ('create_time'=>$create_time,'orderID'=>$orderID, 'status'=>$status,'name'=>$name, 'create_time'=>$create_time,'cost'=>$cost,
'family_name'=>$family_name,'last_name'=>$last_name,'remark'=>$remark,'birth'=>$birth,'sex'=>$sex,'notify_time'=>$notify_time,'wuxing'=>$wuxing);
array_push($members, $arr);
}
$arr = array ('result'=>"OK", 'number'=>$num_rows, 'list'=>$members);
echo json_encode($arr);
}
mysqli_close($link);
?>