[請益] 關於客戶資料新增..幫幫忙吧!謝謝~

看板PHP作者 (*幸福在你身邊*)時間19年前 (2006/12/14 11:21), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/2 (看更多)
關於客戶資料新增.. 可是打好資料想要新增出去~ 就一直出現"無法建立資料:Table 'customer.custom' doesn't exist" 請各位大大幫我想想吧! 感謝0.0 以下是我的頁面碼: <第一頁> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "" rel="nofollow">http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <title>無標題文件</title> </head> <body> <form name="ex1214-1" method="post" action="ex1214-003.php"> <div align="center"> <table width="325" border="1"> <tr> <td width="12">&nbsp;</td> <td width="279"><div align="center">客戶資料新增</div></td> <td width="12">&nbsp;</td> </tr> <tr> <td height="226">&nbsp;</td> <td><p align="center">編號<input type="text" name="ID" size=20 maxlength=20></p> <p align="center">名稱<input type="text" name="Name" size=20 maxlength=20></p> <p align="center">地址<input type="text" name="Address" size=20 maxlength=20></p> <p align="center">電話<input type="text" name="phone" size=20 maxlength=20></p> <p align="center">密碼<input type="text" name="password" size=20 maxlength=20></p></td> <td>&nbsp;</td> </tr> <tr> <td height="28">&nbsp;</td> <td> <div align="center"><input type="submit" name="send" value="新增"> <input type="reset" name="reset" value="取消"></div></td> <td>&nbsp;</td> </tr> </table> </div> </body> </html> <第二頁> <html> <head> <title>確認會員資料頁面</title> </head> <body> <?php $link = mysql_connect('localhost','root','pfnh1103') or die("無法連線:".mysql_error()); $A = $_POST['ID']; $B = $_POST['Name']; $C = $_POST['Address']; $D = $_POST['phone']; $E = $_POST['password']; $SQL = "insert into Custom values('$A','$B','$C','$D')"; $result = mysql_query("use customer"); $result = mysql_query($SQL,$link) or die("無法建立資料:".mysql_error()); ?> </body> </html> <資料庫> create table customer( ID char(10), Name varchar(50), Address varchar(100), phone int, password varchar(100) ); 麻煩各位大大解答,感激不盡~ -- 幸福心會一直幸福下去... http://www.wretch.cc/album/pfnh397 給你幸福心。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.21.78.204

12/14 11:40, , 1F
沒有這個 DB (茶) create database !!
12/14 11:40, 1F

12/14 18:21, , 2F
你的SQL敘述是insert into Custom,但是你的table名稱
12/14 18:21, 2F

12/14 18:22, , 3F
是customer耶!
12/14 18:22, 3F
文章代碼(AID): #15WCDAjF (PHP)
文章代碼(AID): #15WCDAjF (PHP)