我正在创建一个注册表单并遵循此video。
注册无效。用户数据不会传输并显示在phpmyadmin用户表中。你能帮帮我吗?
<?php
include 'dbh.php';
$first = $_post['first'];
$uid = $_post['uid'];
$pwd = $_post['pwd'];
$sql = "INSERT INTO user (first, uid, pwd)
VALUES ('$first', '$uid', '$pwd')";
$result = mysqli_query($conn, $sql);
header("Location: contact.html");
和dbd.php
$conn = mysqli_connect("");
if (!$conn) {
die("connection failed: ".mysqli_connect_error());
}
连接似乎正在起作用,因为它没有写错误,这在我输入错误时已经习得了。