PHP code example of hexastudio / mysqli-wrapper

1. Go to this page and download the library: Download hexastudio/mysqli-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/ */

    

hexastudio / mysqli-wrapper example snippets




$host     = 'localhost';
$user     = 'root';
$password = 'password';
$db_name  = 'database_name';
$port     = 3306; // Optional

$db = new Database($host, $user, $password, $db_name, $port);


/**
 * Sample
 */
$db->where('state', 'Jakarta')
    ->sort('first_name', 'DESC')
    ->limit(0, 5)
    ->get('student');

// Equals to "SELECT FROM `student` WHERE `state` = 'Jakarta' ORDER BY `first_name` DESC LIMIT 0, 5;"