dev-master
9999999-dev http://github.com/rainphp/RainDBDB library wrapper for PDO class
MIT
The Requires
- php >=5.3.0
pdo db
DB library wrapper for PDO class
Rain DB is a component of the RainFramework 3 that works as wrapper for the PDO class., (*1)
This class use Static methods to run the queries. Example: ``` php use Rain\DB;, (*2)
// include the autoloader require "library/Rain/autoload.php";, (*3)
// configure the class DB::configure( array("config_dir"=>"config/"); );, (*4)
// init the connection DB::init();, (*5)
// run a query get one row DB::getRow("SELECT * FROM user LIMIT 1");, (*6)
### Installation You can copy this library in your project using composer. After that you need to configure your connection ### Configure connection This class accepts `mysql`, `pgsql`, `sqlite`, `oracle` and `odbc` drivers. The one that the class uses is defined in the configuration file which by default is `config/db.php`, before using the class you need to edit this file and store your database user, password, etc. #### Loading and initializate the library. To load the class file you can use composer or a PSR autoloader. After configurating the class you can initializate the library using the init method ```php use Rain\DB; require "library/Rain/autload.php"; DB::init();
DB library wrapper for PDO class
MIT
pdo db