Inserting Data from One Table into Another Using SQL
You wish to insert data from the "received_txts" table into the "action_2_members" table based on a specific campaign ID. The data to be inserted includes campaign ID, mobile number, received message, and date received.
SQL Query for Data Insertion
To achieve this, you can utilize the following SQL query:
INSERT INTO action_2_members (campaign_id, mobile, vote, vote_date) SELECT campaign_id, from_number, received_msg, date_received FROM `received_txts` WHERE `campaign_id` = '8'
Explanation
Note:
The above is the detailed content of How to Insert Data from One SQL Table to Another Based on Campaign ID?. For more information, please follow other related articles on the PHP Chinese website!