You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Gerald Richter <ri...@ecos.de> on 2000/05/02 06:12:43 UTC

RE: More questions

>
> (PrevNext question)
> > Yes, I understand, but the current version don't displays First and
> > Previous, if you are already at the start of the recordset. If you need
>
> I don't want that - I want to somehow tableize it, so I can have
> a blank space
> where the First and Previous buttons should have been, if they had been
> usefull. The idea is to help the user, giving the same buttons
> the same place,
> and therefore the user will know where to push with a minimum of reading.
>

Then I think you should split up the result of PrevNextForm somehow and
reassemble it in the desired way.

>
> > afterwards you can just access your database as normal.
> Apache::DBI takes
> > care for you.
>
> I don't get it. Will I have to put something likge
> $db = DBI->connect("dbi:Pg:dbname=$dbname") or die("Unable to
> connect to $dbname");
>
> all over the place?
>
> I thought that somehow I would have a $db variable to use.
>

If you use plain DBI, you have to go that way. Of course you can hide this
in a custom module.

If you use DBIx::Recordset, you can create a DBIx::Database object in your
startup.pl file and refer to it inside your scripts, like:

[-
*set = DBIx::Recordset -> Search ({ '!DataSource' => $main::db, '!Table' =>
.... }) ;
-]

> (module inclusion)
> > package mymodule ;
> > at the top of your module and access the functions via
> > mymodule::foo () ;
>
> Ugh! So I have to put ::'s  all over the place :-( This should work, but
> doesn't:
>
> use mymodule qw(foo);
>
> $bar = foo(1234);
>

This only works if you export the function foo from mymodule. Then it will
work, of course. The perlmod manpage should give you some information on how
to do it.

Gerald



-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------