PHP注册码 [英] PHP Registration code

查看:83
本文介绍了PHP注册码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在尝试创建注册脚本,以将注册信息输入到我的UserAccount表中.以下是我的联系:

I am currently attempting to create a registration script to enter registration information into my UserAccount table. Below is my connection:

<?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;
?>

这是我遇到的困难的注册.

And here is the registration I am having difficulty with.

<?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);


?>

输入信息时,我得到一个空白页,并且表中没有数据输入,我想知道为什么吗?

When entering information I get a blank page and no data entries into my table, I was wondering why?

推荐答案

您有错字

mysql_query($insert);应该是mysqli_query($insert);

您无法在mysqli连接上进行mysql查询.

You can't make mysql queries onto a mysqli connection.

这篇关于PHP注册码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆