I use this query and i get a error :
$description = $request->get('description');
                $description_query = Transcationhistorique::where(function ($query) use ($description, $user_id) {
                    $query->where('receiver_id', $user_id,'description', 'LIKE','%' . $description . '%')
                        ->orWhere('description', 'LIKE','%' . $description . '%','sender_id', $user_id);
                })->get();
and this is the error that I get :
"SQLSTATE[42S22]: Column not found: 1054 Unknown column '0' in 'where clause' (SQL: select * from
transcation_historiquewhere (sender_id= 32 and0= %salaire% and1= LIKE and2= description) orreceiver_id= 32)"
and this what really i want to run:
select * from `transcation_historique` where (`sender_id` = 32 and `description` = %salaire%) or (`receiver_id` = 32 and `description` = %salaire%)
via Chebli Mohamed
 
Aucun commentaire:
Enregistrer un commentaire