是不是代码错误呢? 提交入库不行!
<?php
include("conn.php");
if($_POST['submit'])
{
$sql="insert into ftxia_items (id,ordid,cate_id,orig_id,num_iid,title,intro,tags,nick,uid,uname,pic_url,price,click_url,volume,commission,commission_rate,coupon_price,coupon_rate,coupon_start_time,coupon_end_time,pass,status,shop_type,item_url,ems,hits,inventory,seo_title,seo_keys,seo_desc,add_time,last_rate_time,is_collect_comments)" .
"values ('','$_POST[ordid]','$_POST[cate_id]','$_POST[orig_id]','$_POST[num_iid]','$_POST[title]','$_POST[intro]','$_POST[tags]','$_POST[nick]','$_POST[uid]','$_POST[uname]','$_POST[pic_url]','$_POST[price]','$_POST[click_url]','$_POST[volume]','$_POST[commission]','$_POST[commission_rate]','$_POST[coupon_price]','$_POST[coupon_rate]','$_POST[coupon_start_time]','$_POST[coupon_end_time]','$_POST[pass]','$_POST[status]','$_POST[shop_type]','$_POST[item_url]','$_POST[ems]','$_POST[hits]','$_POST[inventory]','$_POST[seo_title]','$_POST[seo_keys]','$_POST[seo_desc]','$_POST[add_time]','$_POST[last_rate_time]','$_POST[is_collect_comments]')";
mysql_query($sql);
echo "";
}
?>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
-->
</style>
<form name="myform" action="add.php" method="post" onsubmit="return checkpost();">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
    <tr>
      <td height="26" colspan="2" align="center" bgcolor="#F9F9F9"><a href="add.php">添加留言</a> <a href="show.php">查看留言</a> <a href="login.php">登陆</a></td>
    </tr>
    <tr>
      <td width="79" height="34" align="center" bgcolor="#FFFFFF">ordid:自定义排序999</td>
      <td width="518" bgcolor="#FFFFFF"><input name="ordid" type="ordid" id="ordid" size="40" />
      </label></td>
    </tr>
    <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">cate_id:网站分类</td>
      <td height="43" bgcolor="#FFFFFF"><input name="cate_id" type="cate_id" id="cate_id" size="40" /></td>
    </tr>
    <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">orig_id:分类默认1</td>
       <td height="43" bgcolor="#FFFFFF"><input name="orig_id" type="orig_id" id="orig_id" size="40" /></td>
    </tr>
       <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">num_iid:淘宝商品id</td>
      <td height="43" bgcolor="#FFFFFF"><input name="num_iid" type="num_iid" id="num_iid" size="40" /></td>
    </tr>
    <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">title:标题</td>
      <td height="43" bgcolor="#FFFFFF"><input name="title" type="title" id="title" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">intro:信息</td>
      <td height="43" bgcolor="#FFFFFF"><input name="intro" type="intro" id="intro" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">tags:标签</td>
      <td height="43" bgcolor="#FFFFFF"><input name="tags" type="tags" id="tags" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">nick:旺旺号</td>
      <td height="43" bgcolor="#FFFFFF"><input name="nick" type="nick" id="nick" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">uid:用户发布id默认1</td>
      <td height="43" bgcolor="#FFFFFF"><input name="uid" type="uid" id="uid" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">uname:用户发布admin</td>
      <td height="43" bgcolor="#FFFFFF"><input name="uname" type="uname" id="uname" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">pic_url:图片地址</td>
      <td height="43" bgcolor="#FFFFFF"><input name="pic_url" type="pic_url" id="pic_url" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">price:原价</td>
      <td height="43" bgcolor="#FFFFFF"><input name="price" type="price" id="price" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">click_url:淘宝客连接地址</td>
      <td height="43" bgcolor="#FFFFFF"><input name="click_url" type="click_url" id="click_url" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">volume:默认0</td>
      <td height="43" bgcolor="#FFFFFF"><input name="volume" type="volume" id="volume" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">commission:默认0.00</td>
      <td height="43" bgcolor="#FFFFFF"><input name="commission" type="commission" id="commission" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">commission_rate:默认0</td>
      <td height="43" bgcolor="#FFFFFF"><input name="commission_rate" type="commission_rate" id="commission_rate" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">coupon_price:折后价格</td>
      <td height="43" bgcolor="#FFFFFF"><input name="coupon_price" type="coupon_price" id="coupon_price" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">coupon_rate:默认0</td>
      <td height="43" bgcolor="#FFFFFF"><input name="coupon_rate" type="coupon_rate" id="coupon_rate" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">coupon_start_time:开始时间</td>
      <td height="43" bgcolor="#FFFFFF"><input name="coupon_start_time" type="coupon_start_time" id="coupon_start_time" size="40" /></td>
    </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">coupon_end_time:结束时间</td>
      <td height="43" bgcolor="#FFFFFF"><input name="coupon_end_time" type="coupon_end_time" id="coupon_end_time" size="40" /></td>
    </tr>
        </tr>
     <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">pass:是否审核1</td>
      <td height="43" bgcolor="#FFFFFF"><input name="pass" type="pass" id="pass" size="40" /></td>
    </tr>
      <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">status:出售状态默认underway</td>
      <td height="43" bgcolor="#FFFFFF"><input name="status" type="status" id="status" size="40" /></td>
    </tr>
      <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">shop_type:C还是B</td>
      <td height="43" bgcolor="#FFFFFF"><input name="shop_type" type="shop_type" id="shop_type" size="40" /></td>
    </tr>
      <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">item_url:宝贝地址</td>
      <td height="43" bgcolor="#FFFFFF"><input name="item_url" type="item_url" id="item_url" size="40" /></td>
    </tr>
      <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">ems默认0</td>
      <td height="43" bgcolor="#FFFFFF"><input name="ems" type="ems" id="ems" size="40" /></td>
    </tr>
      <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">hits:点击量9999-5000</td>
      <td height="43" bgcolor="#FFFFFF"><input name="hits" type="hits" id="hits" size="40" /></td>
    </tr>
      <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">inventory:库存999</td>
      <td height="43" bgcolor="#FFFFFF"><input name="inventory" type="inventory" id="inventory" size="40" /></td>
    </tr>
      <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">seo_title</td>
      <td height="43" bgcolor="#FFFFFF"><input name="seo_title" type="seo_title" id="seo_title" size="40" /></td>
    </tr>
    <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">seo_keys</td>
      <td height="43" bgcolor="#FFFFFF"><input name="seo_keys" type="seo_keys" id="seo_keys" size="40" /></td>
    </tr>
    <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">seo_desc</td>
      <td height="43" bgcolor="#FFFFFF"><input name="seo_desc" type="seo_desc" id="seo_desc" size="40" /></td>
    </tr>
    <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">add_time:添加时间</td>
      <td height="43" bgcolor="#FFFFFF"><input name="add_time" type="add_time" id="add_time" size="40" /></td>
    </tr>
    <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">last_rate_time:默认0</td>
      <td height="43" bgcolor="#FFFFFF"><input name="last_rate_time" type="last_rate_time" id="last_rate_time" size="40" /></td>
    </tr>
    <tr>
      <td height="43" align="center" bgcolor="#FFFFFF">is_collect_comments:评论默认0</td>
      <td height="43" bgcolor="#FFFFFF"><input name="is_collect_comments" type="is_collect_comments" id="is_collect_comments" size="40" /></td>
    </tr>
    <tr>
      <td height="55" colspan="2" align="center" bgcolor="#FFFFFF"><label>
        <input type="submit" name="submit" id="button" value="提交">
      </label></td>
    </tr>
</table>
</form>

解决方案 »

  1.   

    你 print_r($_POST); 看一下都传过来什么
      

  2.   

    不知道啊! 我用下载了一个留言程序修改的!
    conn.php里面的代码
    <?php
    $conn = @ mysql_connect("localhost", "root", "niaochen") or die("数据库链接错误");
    mysql_select_db("pinphp", $conn);
    mysql_query("set names 'GBK'"); //使用GBK中文编码;function htmtocode($content){
    $content = str_replace("\n","<br>",str_replace(" ","&nbsp;",$content));
    return $content;
    }
      

  3.   

    mysql_query($sql) or die(mysql_error()); //这样报不报错