php - How to execute a raw sql query with multiple statement with laravel - Stack Overflow

PHOTO EMBED

Mon Aug 21 2023 20:28:39 GMT+0000 (Coordinated Universal Time)

Saved by @mvieira

$result = DB::unprepared("LOCK TABLE table1 READ, table1 WRITE, table2 READ, table3 READ;"  
    .  $query_multi_stmt 
    .  " UNLOCK TABLES;");

if ($result > 0 ){  //...if rows affected
           //...do something
}
content_copyCOPY

https://stackoverflow.com/questions/50439029/how-to-execute-a-raw-sql-query-with-multiple-statement-with-laravel