var_dump($ _ POST);是什么意思?返回输入但不在数据库中

时间:2019-03-23 09:48:28

标签: php post

我正在尝试将html / php文件连接到我的数据库。我终于调试了php代码,没有收到任何错误。但是,当我运行文件时,页面只会刷新而无任何作用。我的朋友告诉我有关Var转储函数的信息,我看到我的变量已被填充,但仍然没有任何内容进入我的数据库。我应该看什么?

<?php
$mysqli = new mysqli("127.0.0.1:3307", "root", "", "boosie");

if (mysqli_connect_error()) { 
    echo mysqli_connect_error(); exit; 
}

// The (?,?,?) below are parameter markers used for variable binding

if (isset($_POST['submit'])) {

    $sql = "INSERT INTO signup (First_Name, Last_Name, Email, Password, Re_Password) VALUES (?,?,?,?,?)";
    $stmt = $mysqli->prepare($sql);
    $stmt->bind_param("sssss", $First_Name, $Last_Name, $Email, $Password, $Re_Password); // bind variables

    $First_Name  = $_POST['First_Name'];
    $Last_Name   = $_POST['Last_Name'];
    $Email       = $_POST['Email'];
    $Password    = $_POST['Password'];
    $Re_Password = $_POST['Re_Password'];

    $result = $stmt->execute(); // execute the prepared statement

    echo "New records created successfully "; 

    $stmt->close(); // close the prepared statement
    $mysqli->close(); // close the database connection
}else{

?>

0 个答案:

没有答案