$path="./"; $page_title='Designers'; $page='designers'; $description='Designers - Jelli - Representing Europe\'s finest designer children\'s wear'; $keywords=''; include($path."includes/header.inc.php"); include($path.'templates/header.html.php'); $db = new sql(); $brand_titles = array( "f" => "Girls", "m" => "Boys", "c" => "Unisex", ); $brands = array( "f" => array(), "m" => array(), "c" => array(), ); foreach ($brands as $key=>$array) { $query = "SELECT * FROM `brands` WHERE `invisible` = 0 AND `sex` = '$key' AND `id` IN (SELECT `brand_id` FROM `items_brands` WHERE `item_id` IN (SELECT `id` FROM `items`)) AND `parent_brand` = 0 ORDER BY `name` ASC"; $db->query($query); while($row = $db->fetch_array()) { $brands[$key][] = $row; } } ?>