PHP code example of leafs / db

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

    

leafs / db example snippets


$db = new Leaf\Db('127.0.0.1', 'dbName', 'user', 'password');

# or

$db = new Leaf\Db();
$db->connect('127.0.0.1', 'dbName', 'user', 'password');

db()->connect('127.0.0.1', 'dbName', 'user', 'password');

$users = db()->select('users')->all();