Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [ryel01] generate full category list code

Quote Reply
Re: [ryel01] generate full category list code In reply to
Hi. I would use;

Code:
my $cat_db = $DB->table('Category');
$cat_db->select_options ("ORDER BY Full_Name DESC");
my $sth = $cat_db->select ();
my $output .= "<select name='catid'>";
while (my $cat = $sth->fetchrow_hashref) {
$output .= qq|<option value='$cat->{ID}'>$cat->{Name}</option>|;
}
$output .= q|</select>|;
print $output;

You had 2 declerations of $output, so it was simply overwriting the list :p

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread generate full category list code ryel01 2068 Aug 8, 2004, 3:49 AM
Thread Re: [ryel01] generate full category list code
Andy 1962 Aug 9, 2004, 1:05 AM
Post Re: [Andy] generate full category list code
ryel01 1951 Aug 9, 2004, 1:08 AM