使用此查询插入数据

时间:2017-05-06 04:46:17

标签: php

$korder = mysqli_connect("localhost","root","","korders");

$kio="INSERT INTO `$kioskid`(ordid,odid,oimage,obimage,obprice,oshipc,ofigures,odprice,oquantity,owarpt,oweftt,owarpc,oweftc,zari,sprice,oprice,status,address,payment,shipdate) VALUES('$ofetordid','$ofetdid','$ofetimg','$ofetbimg','$ofetbprice','$ofetshipc','$ofetfig','$ofetprice','$ofetquant','$ofetwarpt','$ofetweftt','$ofetwarpc','$ofetweftc','$ofetzari','$sprice','$sqprice','$status','$address','$payment','$shipdate')";
mysqli_query($korder,$kio);

以上查询无法正常工作......!我不知道该查询背后的错误。

2 个答案:

答案 0 :(得分:0)

查询应该在insert语句中包含表名:

而不是

INSERT INTO `$kioskid`

应该是

INSERT INTO table_name

除非您确定变量$kioskid包含表名。

答案 1 :(得分:0)

尝试构建这样的查询:

TableGroup.propTypes = { fieldNames: React.PropTypes.array.isRequired, dataFields: React.PropTypes.array.isRequired, uniqueField: React.PropTypes.string.isRequired, data: React.PropTypes.array, requestUrlSource: http://someurl/api/resource }