duankang5882 2014-08-14 04:19
浏览 75
已采纳

为什么我不能在phpmyadmin中插入一行?

The problem I'm experiencing is the post is working fine and I echo all of them. There is no error but when I check if inserted to the database, none of the have appeared. Here is the code I have written:

<?php
/* this area is the saving code for the item and description of the pr form */

include("db.php");
$userlogs = mysql_query("SELECT * FROM pr_head ORDER BY rfq_raw_no DESC");
if ($outing = mysql_fetch_array($userlogs)) {
    $rfq_raw_no_out = $outing['rfq_raw_no'] + 1;
}


$RFQ_date_out = $_POST['RFQ_date_in'];
$Vendor_Code_out = $_POST['Vendor_Code_in'];
$Vendor_Name_out = $_POST['Vendor_Name_in'];
$Vendor_Adress_out = $_POST['Vendor_Adress_in'];
$Email_Adress_out = $_POST['Email_Adress_in'];
$Tel_No_out = $_POST['Tel_No_in'];
$ATTENTION_out = $_POST['ATTENTION_in'];
$RFQ_NO_out = $_POST['RFQ_NO_in'];
$DEADLINE_out = $_POST['DEADLINE_in'];
$Prepared_By_out = $_POST['Prepared_By_in'];
$Position_out = $_POST['Position_in'];



mysql_query("INSERT INTO `pr_head`(`RFQ_date`, `Vendor_Code`, `Vendor_Name`, `Vendor_Adress`, `Email_Adress`, `Tel_No`, `ATTENTION`, `RFQ_NO`, `DEADLINE`, `rfq_raw_no`, `Prepared_By`, `Position`) 
                VALUES ([$RFQ_date_out],[$Vendor_Code_out],[$Vendor_Name_out],[$Vendor_Adress_out],[$Email_Adress_out],[$Tel_No_out],[$ATTENTION_out],[$RFQ_NO_out],[$DEADLINE_out],[$rfq_raw_no_out],[$Prepared_By_out],[$Position_out])");
?>
  • 写回答

4条回答 默认 最新

  • dongyuchen9276 2014-08-14 04:29
    关注

    You are inserting a row in an incorrect way. You have to enclose your values in a quotes to make it work. It should be like this VALUES ('$value1'). Change your insert query and use this query to insert it

    mysql_query("INSERT INTO `pr_head`(`RFQ_date`, `Vendor_Code`, `Vendor_Name`, `Vendor_Adress`, `Email_Adress`, `Tel_No`, `ATTENTION`, `RFQ_NO`, `DEADLINE`, `rfq_raw_no`, `Prepared_By`, `Position`) 
                VALUES ('$RFQ_date_out','$Vendor_Code_out','$Vendor_Name_out','$Vendor_Adress_out','$Email_Adress_out','$Tel_No_out','$ATTENTION_out','$RFQ_NO_out','$DEADLINE_out','$rfq_raw_no_out','$Prepared_By_out','$Position_out')");
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 echarts动画效果失效的问题。官网下载的例子。
  • ¥60 许可证msc licensing软件报错显示已有相同版本软件,但是下一步显示无法读取日志目录。
  • ¥15 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加