Insert a record into another table action allows inserting the record into another table of the project.
Type the table name and the fields you want to insert the record into. You also need the data: type in the values manually or use the Database API methods.
This action is available at any event except JavaScript onload events.
.
Example 1. Direct SQL query
//********** Insert a record into another table ************
$sql = "INSERT INTO cars (make, model, price) values
('Toyota', 'RAV4', 16000)";
DB::Query($sql);
Example 2. Database API
//********** Insert a record into another table ************
$data = array();
$data["make"] = "Toyota";
$data["model"] = "RAV4";
$data["price"] = 16000;
DB::Insert("cars", $data );
See also
•Save old data in another table
•Save new data in another table