Hi. I would use;
$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!
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!