老师,这是我创建的一张名为order的表,下面是form表单
<form method="post" action="doAction.php?act=order">
<table border="0" width="400px" class="tb">
<tr><td colspan="2"><h3>填写订单:</h3></td></tr>
<tr height="40px">
<td width="100px">预订人:</td><td><input type="text" class="txt" name="orderName" value="<?php echo $_SESSION['username'];?>"/></td>
</tr>
<tr height="40px">
<td>房间类型:</td><td><input type="text" class="txt" name="orderType" value="<?php echo $row['rName'];?>"/></td>
</tr>
<tr height="40px">
<td>入住日期:</td><td><input type="date" class="txt" name="liveDate" /></td>
</tr>
<tr height="40px">
<td>离开日期:</td><td><input type="date" class="txt" name="leaveDate" /></td>
</tr>
<tr height="40px">
<td>房间数量:</td><td><select name="orderNum"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option></select> 间</td>
</tr>
<tr height="40px">
<td>联系电话:</td><td><input type="text" class="txt" name="tel" value="<?php echo$row1['tel'];?>"/></td>
</tr>
<tr height="40px">
<td>确认方式:</td><td><select class="txt" name="confirmType"><option value="0">电话确认</option><option value="1">邮件确认</option></select></td>
</tr>
<tr>
<td>特殊要求:</td><td><textarea cols="30" rows="5" name="require"></textarea></td>
</tr>
</table>
<p></p>
<input type="submit" class="orderBtn bt1" value="提交订单" />
</form>
下面是doAction.php
elseif($act=="order"){
$orderName=$_POST['orderName'];
$orderType=$_POST['orderType'];
$liveDate=$_POST['liveDate'];
$leaveDate=$_POST['leaveDate'];
$orderNum=$_POST['orderNum'];
$tel=$_POST['tel'];
$confirmType=$_POST['confirmType'];
$require=$_POST['require'];
$sql="insert order(orderName,orderType,liveDate,leaveDate,orderNum,tel,confirmType,require) values('$orderName','$orderType','$liveDate','$leaveDate','$orderNum','$tel','$confirmType','$require') ";
$result=mysql_query($sql) or die(mysql_error());
if($result){
echo"<script>alert('生成订单成功,您可以在会员中心查看您的订单!');window.parent.location='huiyuancenter.php';</script>";
}else{
echo"<script>alert('生成订单失败,请重新预订!');window.parent.location='order.php';</script>";
}
}
为什么不能把数据导入到order表中,错误提示:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order(orderName,orderType,liveDate,leaveDate,orderNum,tel,confirmType,require) v' at line 1
这是什么意思???是数据库出错了么?