will handle your SQL queries with in an easy way, specially created for universty and institute students in their last year project with pure PHP.
- Queryless
- Easy reusing and customizing
- clean code
how to install the easyDB in your projects:
- download easyDB Module as ZIP file, then unzip.
- copy & paste easyDB folder to your project
- finally, in above of your every php file
include 'init.php';how to use easyDB:
- fetch all data from table:
$var = DB::selectAll("table_name");
foreach ($var as $key => $value)
{
echo $value['table_field'] . "<br>";
}- fetch all data with LIMIT from table:
$rows = DB::limit(number)->selectAll("table_name");
foreach ($rows as $key => $value) {
echo $value['table_field'] . "<br>";
}- fetch data by unique id (Primary Key) from table:
$var = DB::selectByID("table_name","unique_id");
foreach ($var as $key => $value)
{
echo $value['table_field'] . "<br>";
}- insert data to table:
DB::save("table_name", [
"table_field_name" => "your value"
]);- update record with unique id (Primary Key)
$unique_id = "20";
DB::updateByID("table_name", [
"table_field_name" => "your new value"
], $unique_id);- delete record with unique id (Primary Key)
$unique_id = "20";
DB::deleteByID("table_name", $unique_id);please dont use this module in production eviroment, happy coding my dears :)