lundi 1 août 2016

Multiple DB update query using Laravel 5

I'm new in Laravel and I'm trying to update mysql table's multiple rows using one query. I need to update for example 100 rows like this:

 $q = \DB::table('exmaple')
                     ->where('exampleID', $array)
                     ->update(array('Viewed' => 1));

$array is array with ID-s. I have try also to implode array to string, then execute query, but with no result. Can anyone help?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2alPoGP
via IFTTT

Aucun commentaire:

Enregistrer un commentaire