Home >Backend Development >PHP Tutorial >运用INSERT INTO语句向数据库中插入数据失败。

运用INSERT INTO语句向数据库中插入数据失败。

WBOY
WBOYOriginal
2016-06-23 13:20:532433browse

 include(conn/conn.php);
if($_POST[submit]){
$code = $_POST['code'];
$note = $_POST['note'];
$routeway = $_POST['routeway'];
$operator = $_POST['operator'];
if($code!= "" || $note != "" || $routeway != "" || $operator !=""){
    $sql ="INSERT INTO code_group  (groupNumber,groupCode,groupNote,groupRouteway,groupOperator) VALUES('','$code','$note','$routeway','$operator')";
if(mysql_query($sql)){
    echo"<script>alert('插入成功');</script>";
    }else{
echo"<script>alert('插入失败');</script>";
}
}else{
echo"<script>alert('您输入的内容为空');</script>"; 

}
?>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn