<?php
include ‘conn.php‘;//连接数据库的文件
$title = $_REQUEST[‘title‘];
$detail = $_REQUEST[‘detail‘];
$idea = $_REQUEST[‘idea‘];
wq_list(自己建立的数据库名)
$sql = "insert into wq_list(wq_title,wq_details,wq_idea,submission_date) values(‘$title‘,‘$detail‘,‘$idea‘,now());";
//自己建立的数据库里的数据表里的字段内容
$ret = $conn->query($sql);
//判断是否成功
if($ret > 0) {
echo ‘{"msg":"success","flag":true}‘;
} else {
echo ‘{"msg":"failed","flag":false}‘;
}
$conn->close();
?>