Please enable JavaScript to view this site.

Navigation: Advanced topics > Events > Predefined actions

Events. Insert a record into another table

Scroll Prev Next More

 

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.

insert_a_record_into_another_table_select_action

.

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

Database API

Save old data in another table

Save new data in another table

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software