Home  >  Article  >  Backend Development  >  php没有办法将数据交付到数据库

php没有办法将数据交付到数据库

WBOY
WBOYOriginal
2016-06-13 12:37:20782browse

php没有办法将数据提交到数据库
  include("connection.php");

    if(isset($_POST["sub"])){
  $title=$_POST['title'];
  $con=$_POST['con'];
  $sql="insert into `news` (`id`,`title`,`dates`,`contents`) values(null,'$title',now(),'$con')";
      mysql_query($sql);
  echo "插入成功";   //提交后没有将数据输入到数据库中
    }else{
      echo "插入失败".mysql_error();
    }

?>

  


  标题

    内容

  
  


php 数据库 mysql
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