MySQL output in two columns
Posted: Sat Sep 17, 2005 11:39 am
I have the following code:
This code shows the categories in only one column. I want '$cat_list' to be displayed in two...
Any ideas?
The upper case letters should be as they are.
Code: Select all
while ($i < $number):
$id = mysql_result($result,$i,"id");
$name = mysql_result($result,$i,"name");
$name = unescape_and_decode( $name );
$uppercase_begin = strtoupper($name[0]);
if ( $uppercase_begin != $at ) {
$cat_list .= "<hr />\n";
$cat_list .= "<a name=\"$uppercase_begin\">\n";
$cat_list .= "<p class=\"index_header\">$uppercase_begin</p>\n";
$cat_index .= " [ <a href=\"#$uppercase_begin\">$uppercase_begin</a> ] ";
}
$at = $uppercase_begin;
$cat_list .= "<a href=\"view_cat.php?id=$id&cat_name=".urlencode($name)."\">$name</a><p></p>";
$i++;
endwhile;
endif;
print $cat_index;
print $cat_list;Any ideas?
The upper case letters should be as they are.