Answer the question
In order to leave comments, you need to log in
Why is information not being retrieved from the database?
Hello.
There is a request in which there are several conditions in which there are parameters and they have a value. The problem is that although the values are transferred to the request itself (debugging), it generally displays emptiness. I don’t understand what this is connected with, although if you manually enter data into the request, it displays information from the database.
Here is the model method:
static public function _sql_all($namebrand,$routename)
{
$series = DB::table('device_series')
->join('model', 'model.id_device_series', '=', 'device_series.id_device_series')
->join('brands', 'model.id_brand', '=', 'brands.id_brand')
->join('category_device', 'brands.id_category_device', '=', 'category_device.id_category_device')
->select('device_series.id_device_series', 'device_series.name_series', 'device_series.img_series', 'category_device.id_category_device', 'category_device.name_category', 'category_device.routename', 'brands.id_brand', 'brands.name_brand')
->where()
->get();
return $series;
class SeriesController extends Controller
{
public function seriesshow($namebrand,$routename){
return view('series.mainseries')->with([
"result" => device_series::_sql_all($namebrand,$routename)]);
}
}
"select `device_series`.`id_device_series`, `device_series`.`name_series`, `device_series`.`img_series`, `category_device`.`id_category_device`, `category_device`.`name_category`, `category_device`.`routename`, `brands`.`id_brand`, `brands`.`name_brand` from `device_series` inner join `model` on `model`.`id_device_series` = `device_series`.`id_device_series` inner join `brands` on `model`.`id_brand` = `brands`.`id_brand` inner join `category_device` on `brands`.`id_category_device` = `category_device`.`id_category_device` where (`brands`.`name_brand` = ? and `category_device`.`routename` = ?)
array:2 [▼
0 => "smartphones"
1 => "Samsung"
]
Answer the question
In order to leave comments, you need to log in
Topic closed.
I substituted values through methods in the request, filtered it and everything worked.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question