当用户在我的网站上注册时,他们需要输入个人详细信息。输入的详细信息将添加到我的数据库中的个人详细信息表中。我有以下代码,但它不起作用,我不知道为什么。任何人都可以帮忙吗?我收到错误:查询为空
$myusername=$_POST['username'];
$mypassword=$_SESSION['mypassword'];
$firstname = $_POST['firstname'];
$surname = $_POST['surname'];
$dob = $_POST['dob'];
$totalwins = $_POST['totalwins'];
$totalloses = $_POST['totalloses'];
$email = $_POST['email'];
$country = $_POST['country'];
$info = $_POST['info'];
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$queryreg = mysql_query("
INSERT INTO $tbl_name VALUES('','','$myusername','$mypassword''$firstname','$surname','$totalwins','$totalloses','$email','$country','$info','$dob' )
");
if (!mysql_query($sql))
{
die('Error: ' . mysql_error());
}
else {
echo "<br><br>Your details have been successfully updated. Go back to the personal details page to view your updated information.";
}