Home  >  Article  >  Backend Development  >  为什么小弟我用php代码插入数据到mysql中 显示为空

为什么小弟我用php代码插入数据到mysql中 显示为空

WBOY
WBOYOriginal
2016-06-13 10:16:52892browse

为什么我用php代码插入数据到mysql中 显示为空
为什么我用php代码插入数据到mysql中 有的字段显示为空 有的就能出现插入的值 我的代码如下


 include("conn.php");

 if ($_POST['submit']){

  $sql="insert into message (id,user,title,content,lastdate) " .
  "value ('','$_POST[user]','$_POST[title]','$_POST[content]',now())";
  mysql_query($sql);
  echo "发表成功";
 }
 ?>

 


  用户:

  标题:

  内容:



 



 


这个事phpmyadmin中的内容
 id user title content lastdate  
 1 我的一个标题 我的PHP 2012-04-15 
 2 _ 我的内容 你的PHP 2012-04-15 
  




------解决方案--------------------
mysql_query($sql) or die(mysql_error());
提出结果!
可能不贴你都知道是怎么回事了
------解决方案--------------------
values 还有什么问题吗?
------解决方案--------------------
用户:

text错了
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