i have one long list generated from a query, but i need to output to a maximum of 4 lists (4 columns) with a maximum of 17 results in each list (total max of 68) as there is a set height and width to fit this in, im new to php so im not sure where to start. I hope that makes sense!
<li class="dir">List title
<?php
// The following query gets all brands that appear in the mens categories and orders by manufacturer name
$mens_categories_products_query = "SELECT * FROM `products_to_categories` `pc` ";
$mens_categories_products_query .= "LEFT JOIN `products` `pr` ON `pc`.`products_id` = `pr`.`products_id` ";
$mens_categories_products_query .= "LEFT JOIN `manufacturers` `mn` ON `pr`.`manufacturers_id` = `mn`.`manufacturers_id` ";
$mens_categories_products_query .= "WHERE `pc`.`categories_id` IN (";
$mens_categories_products_query .= substr($mens_categories_products_ids, 0, strlen($mens_categories_products_ids)-1);
$mens_categories_products_query .= ") GROUP BY `pr`.`manufacturers_id` ORDER BY `mn`.`manufacturers_name`";
//$mens_manufacturers_query = tep_db_query("SELECT * FROM `manufacturers` ORDER BY `manufacturers_name` ASC;");
// Run the new query
$mens_manufacturers_query = tep_db_query($mens_categories_products_query);
$mens_manufacturers_list = "";
while ($mens_manufacturers = tep_db_fetch_array($mens_manufacturers_query)) {
$mens_manufacturers_list .= '<li><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $mens_manufacturers['manufacturers_id']) . '">' . $mens_manufacturers['manufacturers_name'] . '</a></li>';
}
echo "<ul>$mens_manufacturers_list</ul>";
?>
</li>