Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to stop a query if query after it is not inserted in laravel

try {
        //start the transaction
        DB::beginTransaction();

        DB::table('XYZ')->update(['abc'=>'ABC']);
        DB::table('EG')->delete();

        //commit the transaction
        DB::commit();
} catch (Exception $e) {
        DB::rollBack();
        return response;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #stop #query #query #inserted #laravel
ADD COMMENT
Topic
Name
1+1 =