If you want more of my pastes visit: https://randompaste.000webhostapp.com/index.html -------------------------------------------------------------------------------------- view my last post at: https://bitbin.it/gWG48q34/ -------------------------------------------------------------------------------------- $list['id'] , 'title' => $list['titel'], 'scode' => $list['scode'] ); } /* Alle advertenties */ $query_ad = mysql_query("SELECT * FROM tbl_advertenties WHERE sub_rubriek_id='".$array[$j]['id']."' ORDER BY titel ASC"); $array_ad = array(); while (($list_ad = mysql_fetch_assoc($query_ad)) != null) { $array_ad[] = array('id' => $list_ad['id'] , 'title' => $list_ad['titel'], 'scode' => $list_ad['scode'] ); } $titel_advertentie = $array[$j]['titel']; print ''; for ($i = 0, $size = count($array); $i < $size; $i += 2) { $scode = array(); print ''; for ($j = $i, $count = $i + 2; $j < $count; $j++) { if (!isset($array[$j])) { break; } $scode[$array[$j]['id']] = $array[$j]['scode']; $titel_rubriek = $array[$j]['title']; printf('', $array[$j]['id'], $array[$j]['title']) or die (mysql_error()); } print ''; foreach ($scode as $id => $item) { $titel_advertentie = $array_ad[$j]['titel']; //printf('', $array[$j]['id'], $array[$j]['title']) or die (mysql_error()); printf('', $id, $item); } print ''; } print '
- '.$titel_rubriek.'
- '.$titel_advertentie.''.$titel_advertentie.'
'; ?>