in reply to Building SQL Query on the fly
Hi, I think I have another method to do this. (It assumes that you pass only the selected field names as per your example URI ).
use CGI; my $q = new CGI; my %args = $q->Vars; $fields = join(",", sort { $args{$a} <=> $args{$b} } keys %args ) # So +rt with values of hash and Join. It won't put ',' at the end $SQL = "SELECT $fields FROM YOUR_TABLE_NAME";
Cheers !
--VC
|
|---|