A simple PHP library for MySQL DB access and querying.
cd /path/to/put_deebee_in
git clone git@github.com:ekdevdes/deebee.git "deebee"
require_once("deebee/deebee.php");
Note: All the options in the array are optional (including the "database" option) as there are two different ways of establishing a connection
$db = new DeeBee([
"username" => "root",
"pw" => "root",
"hostname" => "localhost",
"database" => "github_db"
]);
OR
Note: The database name is optional
$db = new DeeBee();
$db->username = "root";
$db->pw = "root";
$db->hostname = "localhost";
$db->database = "github_db";
Note: the database name parameter of the set_db()
function is optional, and if not specified will use the database name passed in during class instantiation (whether you've done it the first or second way (above))
$db->connect->set_db("github_db");
OR
$db->connect();
$db->set_db("github_db");
Note: The query()
function returns an array of the results
$results = $db->query("SELECT * FROM users");
Note: The first parameter is the path to SQL file (or any file containing SQL really) that you want to use and the second parameter tells DeeBee to use a SQL file for the query string instead of the query string being passed in a parameter
$results = $db->query("./github.sql", TRUE);