不行我有一個查詢,在phpmyadmin的工作,但不能在PHP的工作(mysqli
)MySQL查詢工作,但在庫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的一個可能的'''? – samayo 2013-03-24 14:46:14
@phpNoOb不,這是通過'\'插入查詢的輸出' – 2013-03-24 14:49:38
我不明白爲什麼有人低估了這個問題! – 2013-03-24 14:54:50