[thelist] Multiple columns - howto?
CDitty
mail at redhotsweeps.com
Wed Feb 19 07:12:01 CST 2003
Many thanks Anthony. That got it. I'll be adding this to my code
snippets. :)
Kae, Thanks also, I'll play with your tonight when I get in.
Chris
At 10:54 PM 2/18/2003, you wrote:
>At 07:28 PM 2/18/2003, CDitty wrote:
>>Thanks Anthony. Unfortnately, I can't get it to work. My logic looks
>>correct, but when I run the script, It total screws up the table and the
>>browser craps out. Any ideas?
>
>Try this....
>
>$sqlCat = mysql_query("select distinct(mainCat) FROM collectible_cats ORDER
>BY mainCat asc") or die(mysql_error());
>$colNum = 0;
>$colCount = 3;
>echo "<table cellpadding='0' cellspacing='0' align='center' border='1'>\n";
>while($row = mysql_fetch_array($sqlCat)){
> $colNum++;
> if($colNum == 1){
> echo "<tr>";
> }
> echo "<td>" . $row["mainCat"] . "</td>";
> if($colNum == $colCount){
> echo "</tr>\n";
> $colNum = 0;
> }
>}
>if($colNum > 0 {
> while($colNum <= ($colCount-1)){
> echo "<td> </td>";
> if($colNum == $colCount){
> echo "</tr>\n";
> }
> $colNum ++;
> }
>}
>echo "</table>\n";
>
>---
>Anthony Baratta
>President
>Keyboard Jockeys
>
>"Conformity is the refuge of the unimaginative."
>
>--
>* * Please support the community that supports you. * *
>http://evolt.org/help_support_evolt/
>
>For unsubscribe and other options, including the Tip Harvester and
>archives of thelist go to: http://lists.evolt.org Workers of the Web, evolt !
More information about the thelist
mailing list