Wrapper for PDO.
Procedure oriented, Pre process, As supplement of ORM.
composer require qdladoooo/sweeter-fetch
require "../vendor/autoload.php";
use SweeterFetch\SweeterFetch;
$sf = new SweeterFetch('host', 'username', 'password');
Execute none query
//return nothing
$sf->Enq('use candy_shop;');
Execute query
//return [row1, row2, ...]
$sf->Eq($sql);
Execute one row
//return the first row by array
$sf->Eor($sql);
Execute column
//return a column
$sf->Ec($sql);
Execute scalar
//return a number
$sf->Es($sql);
The Sweeter-fetch is open-sourced software licensed under the MIT license.