gogoglou has asked for the wisdom of the Perl Monks concerning the following question:
What i want to know is there any method in CGI by which I can create a list of checkboxes which have the names of the columns. And if this is possible can I pass these names, when the checkboxes are checked as parameters in a mysql search later on ? thank you all in advance for your helpprint "Content-type: text/html;\n\n"; use DBI; # Connect to the database # See footnote 1 my $dbh = DBI->connect('DBI:mysql:mirnas', 'user', 'pass') or die "Couldn't open database: $DBI::errstr; stopped"; # Getting all the column names my $table = '07_11_09'; my $sth = $dbh->prepare("SELECT * FROM $table WHERE 1=0;"); $sth->execute; my @cols = @{$sth->{NAME}}; # or NAME_lc if needed $sth->finish; foreach ( @cols ) { printf( " %s", $_ ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl, DBI and CGI checkboxes
by wfsp (Abbot) on Mar 22, 2010 at 16:23 UTC | |
by gogoglou (Beadle) on Mar 25, 2010 at 08:47 UTC | |
|
Re: perl, DBI and CGI checkboxes
by spazm (Monk) on Mar 22, 2010 at 15:53 UTC | |
|
Re: perl, DBI and CGI checkboxes
by Utilitarian (Vicar) on Mar 22, 2010 at 16:01 UTC | |
by gogoglou (Beadle) on Mar 24, 2010 at 12:48 UTC |