Inserting Data into Multiple Tables Simultaneously
The question involves inserting data into two separate tables, visits and registration, in a single query. The desired result for the insertion process is as follows:
INSERT INTO `visits` as v ,`registration` as v (v.`visit_id`,v.`card_id`,r.`registration_id`, r.`type`, r.`timestamp`, r.`visit_id`) VALUES (NULL, 12131141,NULL, UNIX_TIMESTAMP(), v.`visit_id`);
MySQL Limitations
However, MySQL does not allow you to insert data into multiple tables with a single query. This limitation poses a challenge in achieving the desired goal.
Solution Approaches
To overcome this restriction, two alternative approaches are suggested:
以上がMySQL で複数のテーブルに同時にデータを挿入するにはどうすればよいですか?の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。