当用户在我的网站上注册时, 他们必须输入个人细节 。 输入的细节将被添加到我的 Datbase 的个人细节表格中 。 我有以下代码, 但是它不起作用, 我无法找到原因 。 有人能帮忙吗? 我得到错误信息: query was empty
$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.";
}