Php 此代码不会将用户保存的数据插入sql数据库

Php 此代码不会将用户保存的数据插入sql数据库,php,sql,Php,Sql,错误在您的查询中 无法提供类似“上次登录”的列名 请删除之间的空格,并尝试将“status”的列名更改为任何其他符合要求的格式。是否尝试过调试? <?php $con = mysqli_connect("localhost","root","","social_network") or die("Connection was not established"); function InsertUser(){ global $con; //if sign up butto

错误在您的查询中

无法提供类似“上次登录”的列名


请删除之间的空格,并尝试将“status”的列名更改为任何其他符合要求的格式。是否尝试过调试?
<?php

$con = mysqli_connect("localhost","root","","social_network") or die("Connection was not established");

function InsertUser(){
    global $con;
    //if sign up button is pressed
    if(isset($_POST['sign_up'])){
        $name = $_POST['u_name'];
        $pass = $_POST['u_pass'];
        $email = $_POST['u_email'];
        $country = $_POST['u_country'];
        $gender = $_POST['u_gender'];
        $b_day = $_POST['u_birthday'];
        $name = $_POST['u_name'];
        $date = date("d-m-y");
        $status = "unverified";
        $posts = "No";
        //checks if the email already existist in the system
        $get_email = "select * from users where user_email='$email'";
        $run_email = mysqli_query($con,$get_email);
        $check = mysqli_num_rows($run_email);
        //if email validation
        if ($check==1) {
            echo "<script>alert('This email is already registered!, Try another one')</script>";
            exit();
        }
        //password properties string length 
        if(strlen($pass)<8){

            echo "<script>alert('Password should be minimum 8 characters')</script>"; 
            exit();
        }
        else {
            //inserting user input into the database
            $insert = "INSERT INTO users (user_name,user_pass,user_email,user_country,user_gender,user_dob,user_image,register_date,last login,status,posts) VALUES ('$name','$pass','$email','$country','$gender','$b_day','default.jpg','$date','$date','$status','$posts')";

            $run_insert = mysqli_query($con,$insert);

                if($run_insert){
                    echo "<script>alert('Registration Successfull!')</script>";
                } 
            }
        }
    }
?>