There is a relative database
- Названия категорий - Списки категорий
I deduce the names and categories as follows:
$cat_name = DB::table('cat_name')->get(); foreach($cat_name as $row) { $child = DB::table('categories')->where('id','=',$row->id)->get(); echo $row->title; foreach($child as $c) { echo $c->title; } }
I know what I'm doing is wrong, how to display categories correctly?