for($i=1;$i<=3;$i++)
{
$data=DB::table('for_test')
->where('for_test.id','=',$i)
->distinct()
->get();
}
For every loop it selects a different row from ‘for_test’ table. But I cannot store them. How can I store them ? As an example when I write
foreach ($data as $datas) {
echo $datas->name;
}
How can I get three values?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire