我正在嘗試使用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