PHP数据库问题 [英] PHP database problem
本文介绍了PHP数据库问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法在注册页面上创建帐户,我也不知道怎么了.
http://imageshack.us/photo/my-images/97/capturecbs.jpg [ ^ ]
I can''t get my Registration page to create the Account, and i have no idea what''s wrong.
http://imageshack.us/photo/my-images/97/capturecbs.jpg[^]
ini_set('display_errors', true);
error_reporting(E_ALL);
$username = $_POST["RGusername"];
$password = md5($_POST["RGpassword"]);
if($username&&$password)
{
mysql_connect('localhost','root','asdfr');
mysql_select_db("database") or die("Couldn't find database");
$Query = mysql_query("SELECT * FROM account WHERE Username='$username' LIMIT 1");
$id = (mysql_insert_id() + 1);
$rows = mysql_num_rows($Query);
echo $rows ;
if($rows == 0)
{
mysql_query("INSERT INTO `database`.`account' (User_ID, Username, Password)
VALUES(($id), $username, $password)");
echo $password; ?><html> <br /> </html> echo $rows; ?><html> <br /> </html> echo $username; ?><html> <br /> </html> echo $id; ?><html> <br /> </html>
if(mysql_num_rows($Query) == 1)
{
// Successful account creation
echo("Account created");
}
else
echo("Account not created, problem hit");
}
else
echo("Username already exists");
}
else
echo("Please enter all feilds");
?>
推荐答案
用户名 =
username =
_POST [ RGusername"];
_POST["RGusername"];
密码 = md5(
password = md5(
这篇关于PHP数据库问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文