jeudi 3 janvier 2019

Why Laravel5.7 cannot fetch array by using DB faced

I know toAarray(), but it just con only transfer the outmost layer to array type, it was still object inside the result.

l searched a way that modify the config of database.php, add this config 'fetch' => PDO::FETCH_OBJ but it doesn't work. l found laravel use DB::setFetchMode(PDO::FETCH_ASSOC); to set the mode, but seemingly cannot found after 5.5 version.

Is there any other better way to transfer DB faced's result to array?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire