作者pfnh1103 (*幸福在你身边*)
看板PHP
标题[请益] 关於客户资料新增..帮帮忙吧!谢谢~
时间Thu Dec 14 11:24:46 2006
关於客户资料新增..
可是打好资料想要新增出去~
就一直出现"无法建立资料:Table 'customer.custom' doesn't exist"
请各位大大帮我想想吧!
感谢0.0
以下是我的页面码:
<第一页>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
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
1F:推 alpe:没有这个 DB (茶) create database !! 12/14 11:40
2F:→ strawberrya:你的SQL叙述是insert into Custom,但是你的table名称 12/14 18:21
3F:→ strawberrya:是customer耶! 12/14 18:22