-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaddmenu.php
More file actions
35 lines (31 loc) · 741 Bytes
/
Copy pathaddmenu.php
File metadata and controls
35 lines (31 loc) · 741 Bytes
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
<?php
/**
* Created by PhpStorm.
* User: wudan
* Date: 2015/7/14
* Time: 9:44
*/
header("Content-Type: text/html;charset=utf-8");
include "conn.php";
$name = $_POST['dishname'];
$picture = $_POST['picture'];
$desc = $_POST['desc'];
$status = null;
$insrt = "INSERT INTO menu(id, dishname, picture, flag,description) VALUES (null,'$name','$picture',0,'$desc')";
$res = $dbh->query($insrt);
//if ($dbh === false) {
// $status["status"] = false;
//} else {
// $getid = "select max(id) from menu";
// $nid = $dbh->query($getid);
// $row = $nid->fetch();
// $status["id"] = $row;
// $status["status"] = true;
//}
$dbh = null;
//echo json_en($status);
//
//function json_en($val)
//{
// return json_encode($val);
//}