插入共享外键的2个表的语法

时间:2013-11-18 04:30:20

标签: syntax key

当我在线执行此查询时出现错误,但它会在phpAdmin中正常运行。

我错过了什么?

START TRANSACTION;  

INSERT INTO questions(questionTypeID, questionText, questionHelpText, questionImage, 
questionYouTube, questionAddOn, pointsPossible, quizID) 
VALUES('1', 'Name the canal between the two continents', 'Starts with a P', '', '', '0', '89', '9'); 

SET @qID = LAST_INSERT_ID(); 

INSERT INTO possibility (questionID, possibilityText, isCorrectAnswer) 
VALUES (@qID, 'Panama Canal', '1'); 

COMMIT

0 个答案:

没有答案