YouTube Icon

Code Playground.

How to use Select Statement in Laravel 5

CFG

How to use Select Statement in Laravel 5

Using the DB framework, we can pick the record by executing a select statement (selecting the record from the database), you can execute a query using named bindings.

Creating a chosen statement in laravel 5

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

class PostController extends Controller
{
    public function SelectData()
    {
         DB::select('select * from post where id = :id', ['id' => 1]);
    }
}




CFG