2015-02-24 76 views
0

試圖插入2個表的新紀錄MYSQL 1064 TRANSACTION INSERT多表

我得到一個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 'INSERT INTO work_donework_idaccepted_species_iddate_collecteddat' at line 2

BEGIN 
INSERT INTO `work_done`(`work_id`, `accepted_species_id`, `date_collected`, `date_submitted`, `agency_id`, `county_id`, `state_id`, `collection_site_name`, `collection_site_code`, `permit_required`, `permit_id`, `landowner_id`, `datum`, `zone`, `easting`, `northing`, `latitude`, `longitude`, `elevation`, `received_at_dbg`, `received_from`, `date_received`, `received_by`, `passed_on_to`, `date_passed_on`, `comments`, `insufficient_information`, `date_data_input`, `data_input_by`, `frequency`, `site_information`, `submitted_by`, `specific_locality`, `gps_point`) 
VALUES ('','17911','2014-06-14','2015-02-24','10','11','6','Main Site number 6','NULL','no','NULL','NULL','NAD83','NULL','NULL','NULL','39-33.005','105-06.122','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','Rick Levy','NULL','NULL','NULL','NULL','NULL') 
INSERT INTO `restoration_work`(`work_id`,`patch_radius`, `patch_size`, `number_individuals`, `percent_vegetative`, `percent_flowering`, `percent_fruiting`, `species_notes`, `habitat_notes`, `comments`, `photo_number`) 
VALUES ('LAST_INSERT_ID()','NA','180 ft','>40','20','70','10','just beginning to fruit','disturbed, soil along service road mowed','on west side road. widest distribution at north end.','P1060985-88') 
COMMIT 

回答

0

什麼語言/工具/客戶端您使用

如果MySQL命令行工具,你需要什麼? 「」 在

如果是PHP,則需要分別單獨發行一個。

(AUTO_INCREMENT是一個紅色的鯡魚。)

+0

我使用phpMyAdmin來執行一個SQL語句 – Rick 2015-02-25 19:34:55

+0

我不知道;嘗試添加「;」s。 – 2015-02-25 21:47:21