$sql = "insert into media(name,school_no,mobile,qq,school,sex,media_type,interesting,learn,status,used,other,create_at)\n values('{$name}','{$school_no}','{$mobile}','{$qq}','{$school}','{$sex}','{$media_type}','{$interesting}','{$learn}','','{$used}','{$other}','{$create_at}') "; $conn = new mysqli(HOST, UserName, PassWord, DataBase); $conn->query("set names UTF8"); $result = $conn->query($sql); if ($result) { $sql = "select* from media where school_no='{$_POST['school_no']}' order by create_at desc "; $result = $conn->query($sql); $row = $result->fetch_array(); if ($row) { $code = 0; $msg = "success!"; $data = array('UserID' => "{$row['UserID']}", 'name' => "{$row['name']}", 'school_no' => "{$row['school_no']}", 'mobile' => "{$row['mobile']}", 'qq' => "{$row['qq']}", 'school' => "{$row['school']}", 'sex' => "{$row['sex']}", 'interesting' => "{$row['interesting']}", 'learn' => "{$row['learn']}", 'status' => "{$row['status']}", 'used' => "{$row['used']}", 'other' => "{$row['other']}"); api_response::api_method($type, $code, $msg, $data); } } else { $code = -1; $msg = "error:Database Exceptions!"; $data = "null"; api_response::api_method($type, $code, $msg, $data); } } else { $code = -1; $msg = "error:File not uploaded!"; $data = "null"; api_response::api_method($type, $code, $msg, $data); } } } $show = new form_submit(); $show->action();