PHP code example of abosaber / db-wrapper

1. Go to this page and download the library: Download abosaber/db-wrapper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

abosaber / db-wrapper example snippets



use abosaber\DbWrapper\dbwrapper;
$db = new dbhelper();

/* connect to database */
$db->connect("localhost", "root", "", "slms", 3306);



/* insert/update/delete */
$id = $db->insert('tablename', ['col1' => 'foo'])->excute();
$db->update('tablename', ['col1' => 'bar'])->where(['id' => $id])->excute();
$db->delete('tablename')->where(['id'=>$id])->excute();

/* select */
$db->select('tablename', 'columns')->Get_All_Rows();
$db->select('tablename', 'Row')->Get_Row();
$db->select('tablename', 'Row')->where(['id'=>$id])->Get_Row();