Many times you want to use simple db functions to interact with your databse but when you start you have to program exceptions catchers, error handlers and more.. now you can include our BarleyDB library and forget it! You only have to query your database. Thats all!

Example


require_once ('barley.class.php');

Barley::init('localhost', 'user', 'pass', 'db');

// Only use if you want to debug your querys
Barley::enableDebug();

// Execute your query
$result = Barley::query('SELECT * FROM `beers` WHERE barley = 200');

// Execute your query escaping params
$result = Barley::query('SELECT * FROM `beers` WHERE barley_name = "{demo}"');

// If you want to see your debug info
$debugInfo = Barley::debugInfo();
Barley::debug($debugInfo);

Download