PHP code example of upfor / juggler

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

    

upfor / juggler example snippets




use Upfor\Juggler\Juggler;

fig = array(
    'host' => '127.0.0.1',
    'port' => 3306,
    'dbname' => 'db_name',
    'username' => 'your_username',
    'password' => 'your_password',
    'charset' => 'utf8',
    'prefix' => 'db_pre_',
);
$db = new Juggler($config);

// SELECT `user_id`, `username` FROM `user` WHERE `user_id` >= 20
$data = $db->table('user')->field(array('user_id', 'username'))->where('user_id|>=', 20)->getList();
echo json_encode($data);