> >
> >     $db{'$where'} = 'ar_id = ?';
> >     $db{'$values'} = ["$req->{review_num}"];
> >
> >     # If user is a member of acctmgr group, don't show them
Status_Viewed records.
> >     if ($group_file->ismember($req->{user},'acctmgr')) {
> >       $db{'$where'} = $db{'$where'} . ' AND eventcode != ?';
> >       $db{'$values'} = [$db{'$values'},'Status_Viewed'];
> >     }
> >....
>
> This works fine if the two IF clauses fail.  If both of the conditions are
not met then the query works like it should.  If either of the conditions is
met, things
> break.
>
> The $values parameter is getting 'undef' in my DBI->Trace info:
>
> >    -> bind_param for DBD::Sprite::st (DBI::st=HASH(0x85254e4)~0x883b6e4
1 ARRAY(0x8a54604) undef)

It's not undef, but an array refence, where you want to have the content of
the array. The [ ] creates an array and returns a reference to it, so either
write

      $db{'$values'} = [@{$db{'$values'}},'Status_Viewed'];

this will insert the values of $db{'$values'}into the new array (instead of
the reference to the array) or do a

push @{$db{'$values'}}, 'Status_Viewed' ;

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
-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to