php - where method not working in laravel -


I'm trying to use the where statement in laravel, but in return I get Having a blank value

Here is the code

  $ vehicles_make_id = $ _POST ['vehicles_make_id']; // Getting "Audi" $ vehicles_name_trim = $ _POST ['vehicles_name_trim']; // Getting "A3, 2.0t premium automated" $ vehicles_name_trim_ar = explosion (',', $ vehicles_name_trim); $ Model_new = $ vehicles_name_trim_ar [0]; // Getting "A3" $ model_trim = $ vehicles_name_trim_ar [1]; // ("model_name", $ model_name) - & gt; Where ('model_trim', $) "$ 2.0 t premium automated" $ vehicles_body_ar = array_filter (array_interprise (model :: where ('model_make_id', $ vehicles_make_id) - & gt; Model_trim) - & gt; lists ('model_body') )); Print_r (2.0T Premium Automatic);   

I checked and value exists in the database but I am getting an empty array

I think where your wrongs are, they are not missing '='. vehicle_body_ar = array_filter (array_inique (model :: where ('model_make_id', '=', vehicles_make_id) -> where ('model_name', '=', $ model_name) -> where ('model_trim', '=', $ model_trim) - & gt; lists ('model_body')));

Check the final question

  $ queries = DB :: getQueryLog (); $ Last_query = end ($ query); Print_r ($ last_query);    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -