-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgiveName.php
More file actions
50 lines (42 loc) · 1.24 KB
/
giveName.php
File metadata and controls
50 lines (42 loc) · 1.24 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");
// require_once("push/sendMessage.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");
$orderID = $_POST['orderID'];
$name = $_POST['name'];
// return;
if(!$orderID){
$arr = array('result'=>'fail','reason'=>'订单ID不能为空');
echo json_encode($arr);
}
// $sql="select * from record where orderID='".$orderID+"'";
// $result = mysqli_query($link,$querystring);
// $num_rows = mysqli_num_rows($result);
// if($num_rows <= 0){
// return '',
// }else{
// while($row = mysqli_fetch_array($result)){
// $user = $row['mail'];
// return $user;
// }
// }
date_default_timezone_set('Asia/Shanghai');
$sql2 = "update record set status=2, name='".$name."',notify_time= '".date("Y-m-d H:i:s",time())."' where orderID=".$orderID;
$result = mysqli_query($link,$sql2);
// echo $sql2;
// echo $result;
if($result){
$arr = array('result'=>'OK');
echo json_encode($arr);
}else{
$arr = array('result' => 'failed','reason'=>'上传失败','code'=>2,'debug'=>$sql2);
echo json_enncode($arr);
}
mysqli_close($link);
?>