我正在尝试使用html和php来更新mysql数据库。数据库更新(自动增量)键,但不会将任何字符串添加到值中。我已经搜索过类似问题的人,但因为他们的代码与我的不同,我无法理解它(我是一个使用PHP和MySQL的noob)我认为我的问题是,我使用html来获取值的方式,但我可以错无法使用html和php更新mysql中的值
<form action=submitform.php method=GET>
Name:<input type="text" name="cuName" size=20 maxlength=20><br>
Password:<input type="password" name="password" size=20 maxlength=45><br>
Account:<input type="text" name="account" size=20 maxlength=45><br>
Phone:<input type="tel" name="phone" size=10 maxlength=10><br>
Email:<input type="text" name="email" size=20 maxlength=45><br>
<input type=submit>
</form>
和我的PHP是
<?php
mysql_connect(localhost, myUsername, "myPassword");
mysql_select_db(myDatabaseName);
mysql_query("INSERT INTO Customer (cuName, password,
account, phone, email)
Values('$cuName', '$password', '$account',
'$phone', '$email')");
echo $cuName ." thank you for reserving!";
print ($cuName);
?>
在此先感谢您的帮助
非常感谢,我也会试试。 – aldito2 2012-08-07 23:04:06