php插入mysql成功并返回插入id,但mysql数据库中没有记录,为什么?

php插入mysql成功并返回插入id,但mysql数据库中没有记录,为什么?,php,mysql,Php,Mysql,php insert into mysql成功并返回insert id,但mysql数据库中没有记录,mysql查询如下: INSERT INTO `#__vc_transactions` SET `title`='现金币' , `units`='3' , `txn_id`='5FF0BDB3C815A69C' , `txn_amount`='3' , `txn_currency`='CNY' , `txn_status`='pending' , `txn_date`='2016-12-23 0

php insert into mysql成功并返回insert id,但mysql数据库中没有记录,mysql查询如下:

INSERT INTO `#__vc_transactions` SET `title`='现金币' , `units`='3' , `txn_id`='5FF0BDB3C815A69C' , `txn_amount`='3' , `txn_currency`='CNY' , `txn_status`='pending' , `txn_date`='2016-12-23 06:32:38' , `extra_data`=NULL , `service_provider`='System' , `service_alias`='' , `item_id`='2' , `item_type`='currency' , `sender_id`='0' , `receiver_id`='50' , `custom_price`='0' , `order_status`='transfer' , `transfer_type`='1' , `bank`='1'
INSERT INTO `#__vc_transactions` (`title`,`units`,`txn_id`,`txn_amount`,`txn_currency`,`txn_status`,`txn_date`,`extra_data`,`service_provider`,`service_alias`,`item_id`,`item_type`,`sender_id`,`receiver_id`,`custom_price`,`order_status`,`transfer_type`,`bank`) VALUES ('现金币','50','EE2CE817052183C2','45','CNY','completed','2016-12-28 02:33:00','手续费:5','系统','','2','currency','50','47','0','transfer','2','0')
INSERT INTO `#__vc_transactions` (`title`,`units`,`txn_id`,`txn_amount`,`txn_currency`,`txn_status`,`txn_date`,`extra_data`,`service_provider`,`service_alias`,`item_id`,`item_type`,`sender_id`,`receiver_id`,`custom_price`,`order_status`,`transfer_type`,`bank`) VALUES ('现金币','1','C5EAE30FBC59425F','1','CNY','pending','2016-12-28 02:34:35',NULL,'系统','','2','currency','0','50','0','transfer','1','1')
但同时,下面的另一个替代查询是ok的,它记录在mysql数据库中

INSERT INTO `#__vc_transactions` SET `title`='现金币' , `units`='50' , `txn_id`='8DE6C35ED5CD9569' , `txn_amount`='45' , `txn_currency`='CNY' , `txn_status`='completed' , `txn_date`='2016-12-23 06:32:00' , `extra_data`='手续费:5' , `service_provider`='System' , `service_alias`='' , `item_id`='2' , `item_type`='currency' , `sender_id`='50' , `receiver_id`='47' , `custom_price`='0' , `order_status`='transfer' , `transfer_type`='2' , `bank`='0'
为什么?第一个问题是什么

更新 我还更改了另一个查询语句,结果相同,问题也相同 其工作原理如下:

INSERT INTO `#__vc_transactions` SET `title`='现金币' , `units`='3' , `txn_id`='5FF0BDB3C815A69C' , `txn_amount`='3' , `txn_currency`='CNY' , `txn_status`='pending' , `txn_date`='2016-12-23 06:32:38' , `extra_data`=NULL , `service_provider`='System' , `service_alias`='' , `item_id`='2' , `item_type`='currency' , `sender_id`='0' , `receiver_id`='50' , `custom_price`='0' , `order_status`='transfer' , `transfer_type`='1' , `bank`='1'
INSERT INTO `#__vc_transactions` (`title`,`units`,`txn_id`,`txn_amount`,`txn_currency`,`txn_status`,`txn_date`,`extra_data`,`service_provider`,`service_alias`,`item_id`,`item_type`,`sender_id`,`receiver_id`,`custom_price`,`order_status`,`transfer_type`,`bank`) VALUES ('现金币','50','EE2CE817052183C2','45','CNY','completed','2016-12-28 02:33:00','手续费:5','系统','','2','currency','50','47','0','transfer','2','0')
INSERT INTO `#__vc_transactions` (`title`,`units`,`txn_id`,`txn_amount`,`txn_currency`,`txn_status`,`txn_date`,`extra_data`,`service_provider`,`service_alias`,`item_id`,`item_type`,`sender_id`,`receiver_id`,`custom_price`,`order_status`,`transfer_type`,`bank`) VALUES ('现金币','1','C5EAE30FBC59425F','1','CNY','pending','2016-12-28 02:34:35',NULL,'系统','','2','currency','0','50','0','transfer','1','1')
它的工作原理如下:

INSERT INTO `#__vc_transactions` SET `title`='现金币' , `units`='3' , `txn_id`='5FF0BDB3C815A69C' , `txn_amount`='3' , `txn_currency`='CNY' , `txn_status`='pending' , `txn_date`='2016-12-23 06:32:38' , `extra_data`=NULL , `service_provider`='System' , `service_alias`='' , `item_id`='2' , `item_type`='currency' , `sender_id`='0' , `receiver_id`='50' , `custom_price`='0' , `order_status`='transfer' , `transfer_type`='1' , `bank`='1'
INSERT INTO `#__vc_transactions` (`title`,`units`,`txn_id`,`txn_amount`,`txn_currency`,`txn_status`,`txn_date`,`extra_data`,`service_provider`,`service_alias`,`item_id`,`item_type`,`sender_id`,`receiver_id`,`custom_price`,`order_status`,`transfer_type`,`bank`) VALUES ('现金币','50','EE2CE817052183C2','45','CNY','completed','2016-12-28 02:33:00','手续费:5','系统','','2','currency','50','47','0','transfer','2','0')
INSERT INTO `#__vc_transactions` (`title`,`units`,`txn_id`,`txn_amount`,`txn_currency`,`txn_status`,`txn_date`,`extra_data`,`service_provider`,`service_alias`,`item_id`,`item_type`,`sender_id`,`receiver_id`,`custom_price`,`order_status`,`transfer_type`,`bank`) VALUES ('现金币','1','C5EAE30FBC59425F','1','CNY','pending','2016-12-28 02:34:35',NULL,'系统','','2','currency','0','50','0','transfer','1','1')
试试这个

INSERT INTO `#__vc_transactions` (`title`, `units`, ...) VALUES ('abc', '3', ...);

SET命令与UPDATE一起使用,而不是INSERT INTO。您应该使用UPDATE\uu vc\u transactions SET…,但对于一个有效,一个失败的原因,我没有解释,但这并不重要。尝试在值中使用'instead of',我已经更改了此类查询,但问题是相同的!请检查我的update@TimBiegeleisenSET命令也适用于INSERT。它只是没有被广泛使用。我已经改变了这样的查询,但问题是一样的!请检查我的更新