When calling DB::select why do I get a “The connection was reset” message?

前端 未结 2 1854
渐次进展
渐次进展 2021-01-18 06:50

In my Laravel 5.5 application, calls to DB::select which run a select query on a Postgresql database fail without showing any error in the Apache or Laravel error logs and t

2条回答
  •  天命终不由人
    2021-01-18 07:00

    i think its an Sql query error

     `SELECT * from test()` 
    

    Since () bracket indicates the function so try to use like

     `SELECT * from test` in your query 
    

    Best way in laravel

    Create a model with php artisan make:model Test

    Then use in controller like

         `use App\Test;'
    

    and then to fetch records Test::all(); it will bring all records from database like your requirement SELECT * from Test

提交回复
热议问题