[ic] SQL Statements within Usertags

Rich Doughty interchange-users@icdevgroup.org
Thu Jan 16 07:30:01 2003


On 16 Jan 2003, Stefan Hornburg wrote:
> On Thu, 16 Jan 2003 09:52:35 +0000
> Rich Doughty <rich@opusvl.com> wrote:
> 
> > whats the "recommended" way of executing SQL within a usertag? I've been
> > using $Tag->sql (...), but is there any way of accessing the DB connection
> > object for example, and avoiding the $Tag->sql (...) overhead?
> 
> I often use the following technique:
> 
> [perl tables=foo]
> $set = $Db{foo}->query('select question,answer from foo');
> for (@$set) {
>     ($question, $answer) = @$_;
>     ...
> }
> [/perl]
> 

cheers.

were using mysql exclusively, so can the table name be arbitrary, or does it
have to be one of the explicitly registered tables (products, userdb - in
our case)?


  - Rich Doughty