< ;body>

This is a news system< /h1>

Title:


Content:






#new_post.php

header("Content-type;text/html;charset=utf-8");
$_POST['title'] = empty($_POST['title']) ? '' : $_POST[ 'title'];
$_POST['content'] = empty($_POST['content']) ? '' : $_POST['content'];
$title=$_POST['title' ];
$content=$_POST['content'];

$time=date("Y-m-d H:i:s");
$conn = mysqli_connect('localhost',' root','root','new','30');
mysqli_set_charset($conn,'utf8');
if($conn){
$sql="insert into news(title ,content,cre_time) VALUES('$title','$content','$time')";
$que=mysqli_query($conn,$sql);//Execute sql statement
if($ que){
using using using using using using using using ‐ ‐ que){
‐ ‐ ‐ echo "";
}else{
die ("Database connection failed".mysqli_connect_error());
}

}###
Tassel
Tassel

reply all (2)
ringa_lee

The data cannot be inserted into the database. There are many situations. Is there any error message? If not, use breakpoint debugging to find the problem!

    代言

    Print the $sql statement and observe.

      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!