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

WBOY
Release: 2016-06-13 12:37:20
Original
778 people have browsed it

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
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!