문제

When i use the following command:

insert into history (id, command)  
values(2,'insert into show(id, moderator_ID, film_ID, time_length, adress, details) values(42,2,1,'123','123','123')');  

It returns an error: missing comma. Why?

도움이 되었습니까?

해결책

Use double quote instead of single quote in second insert query

insert into history (id, command)  
values (2,'insert into show 
(id, moderator_ID, film_ID, time_length, adress, details) 
values (42,2,1,\"123\",\"123\",\"123\")'); 

다른 팁

Use double quote like this :

INSERT INTO `history` ( `id` , `command` )
VALUES ( '2', 'insert into show(id, moderator_ID, film_ID, time_length, adress, details) values(42,2,1,''123'',''123'',''123'')');
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top