【发布时间】:2013-03-14 01:11:50
【问题描述】:
我有一个可以在 phpmyadmin 中工作但不能在 php 上工作的查询 (mysqli)
问题出在哪里?
查询:
INSERT INTO `SepidarSoft_Portal`.`Archive_Media` SET `CTime`='1364135670',`UTime`='1364135670',`PID`='',`State`='1',`Sequence`='0',`Subject`='Hojom Marg ( www.Parstafrih.ir )',`Text`='',`Description`='',`Definition`='',`KeyWord`='',`ETag`='',`Access`='',`LinkToPage`='',`Attachment`='[{\"Name\":null,\"Kind\":null,\"Size\":false,\"Address\":\"27\",\"More\":{\"Original\":1}}]',`STime`='0',`ETime`='0';
SET @LAST_ID:=LAST_INSERT_ID();
INSERT INTO `SepidarSoft_Portal`.`Archive_Media_MoreInfo` (`id`,`Key`,`Value`) VALUES (@LAST_ID,'Instrumental','1'),(@LAST_ID,'KindFile','صوتی'),(@LAST_ID,'Genre','نغمه'),(@LAST_ID,'SName','Amir Tajik ( www.Parstafrih.ir )'),(@LAST_ID,'Events','[[\"\"]]'),(@LAST_ID,'Album','( www.Parstafrih.ir )'),(@LAST_ID,'Composer',''),(@LAST_ID,'Adjustment',''),(@LAST_ID,'Subtitle','[object HTMLInputElement]'),(@LAST_ID,'Release','');
错误:
#1064 -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 'SET @LAST_ID:=LAST_INSERT_ID();
1) 我为此使用 php mysqli_multi_query
【问题讨论】:
-
你是否在 mysql 中插入了一个可能的
'? -
@phpNoOb 不,这是
\'的查询插入导出 -
我不明白为什么有人反对这个问题!
标签: php sql mysqli mysqli-multi-query