How to separate database results into 2 columns?

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

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

How to edit the text string "Contact Form"

Updated November 22, 2017 01:10 AM

Why int(11) on database integer columns?

Updated August 05, 2015 13:04 PM

Joomla SQL drivers and prepared statements

Updated August 11, 2015 17:04 PM