How to separate database results into 2 columns?

by Mythic   Last Updated June 30, 2019 20:10 PM

I saw the examples of how to do the odd even way, but I want the order to flow from one whole column to the next and not alternating left to right for each alphabetical item. Can this be done?

Here is the query

$db = JFactory::getDbo();
$db->setQuery('SELECT title, introtext 
               FROM #__content
               WHERE introtext LIKE "%Still Airing%"
               ORDER BY title ASC');
$row = $db->loadAssocList();

I tried dividing it by 2, but then how do you get each column to appear in html?

$half = count(#row) / 2;

What I was thinking was I could use the variable to list that number of items in each column (or table tds) , but don't know the syntax or if I'm doing it right. Like list $half items and then the rest in the next column.

Tags : php database


Related Questions


Updated July 13, 2016 08:04 AM

Updated November 15, 2016 08:04 AM

Updated November 22, 2017 01:10 AM

Updated August 05, 2015 13:04 PM

Updated August 11, 2015 17:04 PM