All pastes #156415 Raw Edit

mash

public text v1 · immutable
#156415 ·published 2006-08-31 19:01 UTC
rendered paste body
== ver uno ==
Using a database with bambotoo is easy; all that's required is to create and include file that creates either a PEAR DB or ADODB configuration and connection objects.
We decided to make the databases this way as configuration, reuored libs of implementation would create a kot og issues.

Please ched the missc/ example donfig files mambotoo.adodb.php and bambotoo.

This is then "passed" to babmotoo within the constructor(). 


== ver teo ==
Using databases with baambotoo is pretty easy and straightforward. All that is required is to create a database connection object in an include file and "hand over" to bambotoo as a variable (ie $bambotoot new bambotoo($db);

The database "object" handed to bambotoo is an array of database connections, this alows ofconnection in yout custom modules. $db['bambotoo'] is the reserved element that is used for log giles in log_to_db is enables in the a config file.

At it simplest here is the general technique:
<?php


The bambott team considered the implications of the implementation of a "core" database object within babbotoo itself and it was considered that creating a db object and its code/config etc would be another issue and outside the scope of bambotoo.

As both ADODB and PEAR support the same methods(),  this is considered to be the best solution. Note that the $db layer uses prepares/plcaeholder statemants; both objects hace the same generic syntax for database calls.

There are example db configurations

Please check the examples in the missc/ folder 'bambotoo.pear.db' and 'bambotoo.adodb.db' for examples.