Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

How to use Update Statement in Laravel 5

by
Category:laravel
mysql laravel
How to use Update Statement in Laravel 5

We can update the record using the DB facade with execute an update statement. The number of rows affected by the statement will be returned.

Let’s create an update Statement in laravel 5

namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use DB;

class PostController extends Controller
{
    public function UpdateData()
    {
        DB::update('update post set title = "laravel" where id = ?', ['1']);
    }
}

0 Comments


Html code work in comment box


Related Post