Search
 
SCRIPT & CODE EXAMPLE
 

SQL

DB::transaction

DB::beginTransaction();

try {
    DB::insert(...);
    DB::insert(...);
    DB::insert(...);

    DB::commit();
    // all good
} catch (Exception $e) {
    DB::rollback();
    // something went wrong
}
Comment

DB::transaction

use IlluminateSupportFacadesDB;

DB::transaction(function () {
    DB::update('update users set votes = 1');

    DB::delete('delete from posts');
});
Comment

PREVIOUS NEXT
Code Example
Sql :: date in where on datetime column clause mysql 
Sql :: oracle exceeded simultaneous sessions_per_user limit 
Sql :: oracle sysdate 
Sql :: SQL SERVER SELECT BETWEEN DATETIME 
Sql :: mysql add fields 
Sql :: array out of range mql4 
Sql :: sql display number without decimals 
Sql :: postgres create type 
Sql :: sql not contains 
Sql :: grant access on table in oracle 
Sql :: mysql order by desc null last 
Sql :: clear a table in mysql 
Sql :: oracle tables with column name 
Sql :: mysql workbench requires visual c++ 2019 redistributable package 
Sql :: sql group by year 
Sql :: postgres set default schema 
Sql :: docker run postgres locally 
Sql :: mysql columns values as comma separated string 
Sql :: mysql date time string format python 
Sql :: what is integrity constraints 
Sql :: sql view where tables have same column name combine results 
Sql :: drop table with constraints 
Sql :: MYSQL select last query 
Sql :: sql server concat string and int 
Sql :: how to update random rows in sql 
Sql :: creating a table in sql 
Sql :: postgres create extension if not exists 
Sql :: sql extract numbers from string 
Sql :: postgresql set auto increment value 
Sql :: sql get month from date 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =