我目前正在尝试创建一个注册脚本以将注册信息输入到我的 UserAccount 表中。以下是我的连接:
<?php
//database preparation
$usr = "username";
$pwd = "password"; //put your php password
$host = "computing";
$db = $usr;
$conn = mysqli_connect($host, $usr, $pwd, $db);
if (!$conn){
echo "<p>server connection error:
mysqli_connect_error()</p>";
}
$_SESSION['conn'] = $conn; //database connection status
transfer;
?>
这是我遇到困难的注册。
<?php
include "conn.php";
$email_address = $_POST['email_address'];
$password = md5($_POST['password']);
$f_name = $_POST['f_name'];
$s_name = $_POST['s_name'];
$insert = 'INSERT INTO UserAccount(email_address, password, f_name, s_name)
VALUES("'.$email_address.'","'.$password.'","'.$f_name.'","'.$l_name.'")';
mysql_query($insert);
?>
输入信息时,我得到一个空白页,并且表格中没有数据条目,我想知道为什么?