I have an array which comprises many table and and their contents value for updating, I use foreach loop to get one by one a table and their updating record, then call a function which update the table
Code:
foreach($tables as $key=>$value) {
function inset_data_into_table(take_table_name , table_field_and_value);
}
For example: If there are three table in array then three loops would be run, if two loops executed successfully but in third loop if there is an error come, then I want to rollback previous two loops inserted data. How it is possible.