Level 1
Select hobby
{{
$results = DB::table('hobby_view')->where('emp_id', $data->id)->get()
@if(!$results->isEmpty())
$hb = array();
$i=0;
@while($hobby = $results->fetch())
$hb[$i] = $hobby['hobby_name'];
$i++;
@endwhile
@endif
}}
{{
$stmt = DB::select("select * from hobby")
@while($rowhobby = $stmt -> fetch())
$hobby = print_r($rowhobby['hobby_name'], true); }}
{{ $hobby }}
{{@endwhile}}
this is php code i want this concept in laravel to fetch the data into dropdown how i can do? i tried but it's show so much syntax error?