Really appreciating your help Gerald!
After
>my $q = new CGI ;
>%fdat = $q -> Vars ;
the prevnextform method now works! Although, I thought %fdat was filled
automatically.
1) But I now experience an other mysterious parameter problem:
First time the table is printed all the columns are alright, but after
submitting anything more, i.e pressing for example 'Submit Queries' or the
post-sorting buttons I've created, the first of the columns (fields) are
appended to the table (DB: 'SELECT id, description, score, id FROM table1').
The $fields come from $joined_col (generated as below) which also wrongly has
the first column added. Printing out %fdat shows columns=>id and not the rest
of the selected columns, even though they appear in the table. Very strange!
Also, must I use the object-oriented syntax since it now is introduced at the
top?
print checkbox_group(-name =>'columns',
-values=>[@$columns],
-rows =>3),br;
$joined_col = join(",",param('columns'));
....
*set = DBIx::Recordset->Search({%fdat,('!DataSource' => $db, '!Table' =>
$table, '$fields' => $joined_col, '$where' => $query, '$max' => 5)});
2) If I want to get the total number of records for a query I can make a SELECT
COUNT(*) statement without $max. But is there a more neat way to see this in
DBIx::Recordset?
Regards
Marcus
> How do you fill %fdat? %fdat should contain your parameters passed to the
> script e.g.
>
> my $q = new CGI ;
>
> %fdat = $q -> Vars ;
>
> Gerald
>
> > ****
> > use strict;
> > use DBIx::Recordset;
> > use vars qw(*set %fdat);
> > ....
> > *set = DBIx::Recordset->Search({%fdat,('!DataSource' => $db,
> > '!Table' => $table,
> > '$fields' => $joined_col,
> > '$where' => $query,
> > '$max' => 5)});
> > if (keys %fdat == 0) {
> > print "<b>%fdat undef</b>",br;
> > } else {
> > print "<b>%fdat def</b>",br;
> > while (($a,$b) = each %fdat) {
> > print "$a => $b";
> > } }
> > *****
> > Marcus
> >
> > > if(undef %fdat) {
> >
> > > This will undef the content of %fdat so it will always be empty!!!
> > >
> > > To test if a variable is defined used defined($foo), but you can't ask
> for
> > > a hash or a array if it's defined, you only could ask if it contains any
> > > keys, so you need to write:
> > >
> > > if (keys %fdat == 0) {
> > >
> > > > print "<b>%fdat undef</b>",br;
> > > > } else {
> > > > print "<b>%fdat def</b>",br;
> > > > while (($a,$b) = each %fdat) {
> > > > print "$a => $b";
> > > > }}
> > >
> > > Does it print out %fdat now?
> > >
> > > Gerald
> > >
> > > -------------------------------------------------------------
> > > Gerald Richter ecos electronic communication services gmbh
> > > Internetconnect * Webserver/-design/-datenbanken * Consulting
> > >
> > > Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
> > > E-Mail: [EMAIL PROTECTED] Voice: +49 6133 925131
> > > WWW: http://www.ecos.de Fax: +49 6133 925152
> > > -------------------------------------------------------------
> >
> >
>
> -------------------------------------------------------------
> Gerald Richter ecos electronic communication services gmbh
> Internetconnect * Webserver/-design/-datenbanken * Consulting
>
> Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
> E-Mail: [EMAIL PROTECTED] Voice: +49 6133 925131
> WWW: http://www.ecos.de Fax: +49 6133 925152
> -------------------------------------------------------------