Gossamer Forum
Quote Reply
category list
How can i generate a category list in this format?

001 auctions
002 dating
003 fighting
004 freebies
005 gambling
006 gaming
007 google
008 misc.
009 msn
010 musics

Quote Reply
Re: [xpert] category list In reply to
Code:
my @cats = $DB->table('Category')->select( 'Name' )->fetchall_list;
my $i = 0;

for (@cats) {
print sprintf("%.3d", ++$i) . " $_\n";
}

Last edited by:

Paul: Jul 2, 2002, 12:47 PM
Quote Reply
Re: [Paul] category list In reply to
Hi, Paul where should i add thi code, sorry, i'm newbie at Links!
Quote Reply
Re: [xpert] category list In reply to
You can add it as a global by surrounding it with sub { } ....bear in mind you might not want to do it if you have about 50,000 categories :)
Quote Reply
Re: [Paul] category list In reply to
Thx Paul, luckily i only have 10 category!
Quote Reply
Re: [Paul] category list In reply to
hmm.this worked nciely with static setup but i dun think it will work at all within my php frontend?