|  Download LMSQLLMSQL is a simple MySQL class that uses PDO. With LMSQL you don't need to write a lot of code to get results from a table and it's very easy to use. DocumentationInstallationrequire_once('mysql.class.php');
 CommandsConnect$mysql = new LMSQL('localhost', 'root', '123456', 'databaseName', true);
 or $mysql = new LMSQL('localhost', 'root', '123456', 'databaseName');
$mysql->connect();
 default charset is utf8. selectGet data from table with where clause, limit, order and custom index @return array 
Simple usage
$data = $mysql->select(['table'=>'news']);
With fields, where clause, order and limit.
$data = $mysql->select([
'table'=>'tableName', 
'fields'=>'id, title, body', 
'where'=>['category'=>'news'], 
'order'=>'id DESC', 
'limit'=>10
]);
With custom array index
$data = $mysql->select([
'table'=>'tableName', 
'index'=>['column'=>'type', 'multi'=>true]
]);
With custom SQL
$data = $mysql->select(["sql"=>"SELECT news_title FROM news, category WHERE news_category = category_id and category_type = 'active'"]);
 loadGet one row from table @return array $data = $mysql->load(['table'=>'news', 'where'=>'id = 1']);
 insertInsert data to table $mysql->insert(['table'=>'users', 'values'=>['fullname'=>'Arash', 'company'=>'Leomoon']]);
 updateUpdate rows $mysql->update(['table'=>'users', 'where'=>['id'=>2218], 'values'=>['name'=>'Amin']]);
 deleteDelete rows $mysql->delete(['table'=>'tableName', 'where'=>['id', '817']]);
 totalGet total rows @return int $mysql->total(['table'=>'tableName', 'where'=>'id > 5']);
 or $mysql->count(['table'=>'tableName', 'where'=>['status'=>'active', 'category'=>'something']]);
 insertIdGet the last inserted id $mysql->insertId();
 searchSearch in all fields $mysql->search([
        'table'=>'news',
        'word'=>'%fake%'
    ]);
 Search in specific fields $mysql->search([
        'table'=>'news',
        'word'=>'%fake%',
        'searchs'=>['title']
    ]);
 schemaShow tables of current DB: $mysql->schema();
 Show columns: $mysql->schema(['table'=>'YourTableName']);
 execExecute your custom sql query $mysql->exec($sql);
 |