[請益] 關於客戶資料新增..幫幫忙吧!謝謝~
關於客戶資料新增..
可是打好資料想要新增出去~
就一直出現"無法建立資料: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"> </td>
<td width="279"><div align="center">客戶資料新增</div></td>
<td width="12"> </td>
</tr>
<tr>
<td height="226"> </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> </td>
</tr>
<tr>
<td height="28"> </td>
<td> <div align="center"><input type="submit" name="send" value="新增">
<input type="reset" name="reset" value="取消"></div></td>
<td> </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
12/14 11:40, 1F
→
12/14 18:21, , 2F
12/14 18:21, 2F
→
12/14 18:22, , 3F
12/14 18:22, 3F
討論串 (同標題文章)
完整討論串 (本文為第 1 之 2 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章
4
18
6
15