嗯,我有一个问题,但我找不到它。我改变了一切,每次都尝试了不同的东西,我最终得到了这个看起来不错但仍然不起作用的编码。我想知道是否有人可以帮助我找到它。
这里表格的动作:
<?php
$username = "Test";
$password = "dbpw";
$hostname = "localhost";
//connection to the database
$con = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "Connected to MySQL";
?>
<?php
$db_select = mysql_select_db("CS450Game", $con);
if(!$db_select){
die("Database selection failed: " . mysql_error());
}
?>
<?php
$lname = mysql_escape_string($_POST['txt_Lname']);
$mi = mysql_escape_string($_POST['txt_MI']);
$fname = mysql_escape_string($_POST['txt_Fname']);
$month = mysql_escape_string($_POST['lst_dobmonth']);
$day = mysql_escape_string($_POST['lst_dobday']);
$year = mysql_escape_string($_POST['txt_dobyear']);
$address = mysql_escape_string($_POST['txt_address']);
$city = mysql_escape_string($_POST['txt_city']);
$state = mysql_escape_string($_POST['lst_state']);
$zip = mysql_escape_string($_POST['txt_zip']);
$hphone = mysql_escape_string($_POST['txt_HPhone']);
$cphone = mysql_escape_string($_POST['txt_CPhone']);
$email = mysql_escape_string($_POST['txt_email']);
$email2 = mysql_escape_string($_POST['txt_email2']);
$country = mysql_escape_string($_POST['lst_country']);
mysql_query("INSERT INTO `Customer` (`txt_Lname`, `txt_MI`, `txt_Fname`, `lst_dobmonth`, `lst_dobday`, `txt_dobyear`, `txt_address`, `txt_city`, `lst_state`, `txt_zip`, `txt_HPhone`, `txt_CPhone`, `txt_email`, `txt_email2`, `lst_country`)
VALUES ('$lname', '$mi', '$fname', '$month', '$day', '$year', '$address', '$city', '$state', '$zip', '$hphone', '$cphone', '$email', '$email2', '$country')");
echo "You info has been submitted";
?>
在此先感谢,我尝试了一切,但它不起作用。
我的错误是我没有任何错误......它一切正常,但只是没有写在数据库上!
请帮忙!