mardi 29 septembre 2020

Laravel WhereIn

i have maded and database that's name is l6app and i have maked an table product_adds in this table i have save secondary id in array formate. now i am getting data behalf of arrays id using this Query in phpmyadmin

saved data in database like [4,6,5,7,8,]

SELECT * FROM tbl_product WHERE secondy_id IN (4, 5, 6)

above query woring fine in mysql but after that i am using this query in laravel

$product = Product::select("*")
                ->whereIn('secondy_id', [4, 5, 6])
                ->get();

this query not woring in laravel 6.0 showing blank array when i am fetching data from this table



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire