That basically did the trick.
The data I'm trying to pull out are employee names and their extensions
Of which are split up into three diff fields within the dbase (first, last, and ext).
I have a variable that combines the first name + last name.
So, now it's just the full name and extension I need to show. I want it to appear as four columns.
fullname1 ext1 fullname4 ext4
fullname2 ext2 fullname5 ext5
fullname3 ext3
Where the fullname and ext appear in two different columns
My Current Code
include_once('../connects/db_directory.php');
$query = "select * from employees where ext is not null order by first_name";
$result = $db->query($query);
$emp = $result->fetch_assoc();
$color1 = "#E3D9CA";
$color2 = "#F8F8F8";
$color_count = 0;
//while($r=mysql_fetch_array($getpress)) {
while ($emp = $result->fetch_assoc())
{
$fullname = $emp['first_name']." ".$emp['last_name'];
$row_color = ($color_count % 2) ? $color1 : $color2;
$theArray[] = '<span bgcolor="$color1";">'.$fullname.'</span>
<span bgcolor="$color2";">'.$emp['ext'].' </span><br>';
$color_count++;
}
// Now just output either a vertical or horizontal table:
vertHorizLoop($theArray, 2, 0, 1);
// Use $theArray to construct a 2 column NON-horizontal (Vertical) table
Everything above the include is identical to the code you provided in
http://phpbuilder.com/board/showthread.php?t=10331282&highlight=vertical+Horizontal+Loop
above the //Your Code section
Which basically gets all the info I wanted in to two columns.
I'm getting results like
fullname1 ext1 fullname4 ext4
fullname2 ext2 fullname5 ext5
fullname3 ext3
Where the fullname and ext are showing with a single space in between.
I didn't get the colors to work either; however, that's a different pot of gumbo