[Cartoweb-users] Calling PEAR DB functions
Max Ueda
mhanzo at yahoo.com
Mon Jan 8 13:00:55 EST 2007
Thanks Alexandre and Yves,
When I wrote this e-mail, I was intending to use
Alexandre's approach (calling the methods from the
Utils static class), with Yves' way of calling the
functions (I need getAll() from PEARDB).
I think the right question shouldn't be the way I've
written (how to access the PEAR DB Methods), but the
following: Regarding some DB funcions such as
fechRow() (I've been using this with no problem), what
other PEAR DB functions are avaliable at the Utils
class?
Thank you!
Max Ueda
--- Alexandre Saunier
<alexandre.saunier at camptocamp.com> wrote:
> Hello,
>
> the solution described by Yves works indeed.
> But it's faster to use some CartoWeb built-in static
> methods from the
> Utils class. For instance:
>
> $sql = '...';
> $someValidDsn = '...';
> $someOptionsArray = array(...); // that's the
> options array from
> DB::connect()
> Utils::getDb($db, $someValidDsn, $someOptionsArray);
> $res = $db->query($sql);
> Utils::checkDbError($res, 'Some error message');
> //...
>
> No need to require() or include() any file: the
> Utils class is always
> available.
>
> AS
>
> Max Ueda wrote:
> > Hi,
> >
> > I've been trying to call some PEAR functions at my
> > plugins, with no success. How can I have access to
> the
> > functions getOne(), getRow(), getCol(),
> getAssoc()
> > and getAll()?
> >
> > Thanks in advance,
> >
> > Max Ueda
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the Cartoweb-users
mailing list