Bladephp: Now with 7+ codeigniter, php, and laravel project 7+ php project From $18/Year From Rs. 1000/Year

How to use Select Statement in Laravel 5

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

We can select the record using the DB facade with execute a select statement (select the record from the database), you may execute a query using named bindings.

Let’s create a select 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]);
    }
}

0 Comments


Html code work in comment box


Related Post