In the above code insteaf od the array filling by all usernmes selected from the dataabse it only populates the 1st one.$select = $db->prepare( "SELECT username FROM users" ); $select->execute; my @userlist = $select->fetchrow_array; print start_form( action=>'/cgi-bin/index.pl' ); print h1( {class=>'lime'}, "Επέλεξ& +#949; το κείμενο π& +#959;υ σε ενδιαφέ&# +961;ει => ", popup_menu( -name=>'select', -values=> +\@userlist ), submit('Εμφάν +ιση')); print end_form;
Although @titlelist is filled with all entried from titlelist.txt file(one entry per line), when it gets printed with popup_menu it displasy nothing!!my @titlelist; open FILE, "<$ENV{'DOCUMENT_ROOT'}/data/vault/titlelist.txt" or die $! +; @titlelist = <FILE>; close FILE; print br() x 3; print start_form( action=>'/cgi-bin/admin.pl' ); print table( {class=>'user_form'}, Tr( td( 'Πές μου τι _ +2;α ήθελες:' ), + td( popup_menu( -name=>'title' -values=>\@titlelist ))),
In reply to Populating an array from a mysql select by Nik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |