PHP code example of simpl / sql

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

    

simpl / sql example snippets


$db = new \Simpl\SQL('localhost', 'your-db-name', 'your-username', 'your-password');

$config = [
    'prefix' => 'mysql',
    'host' => 'localhost',
    'port' => 3306,
    'dbname' => 'your-db-name',
    'username' => 'your-username',
    'password' => 'your-password'
];
$db = new \Simpl\SQL($config);


$res = $db->query('select * from test where foo = ? or bar = ?', [$foo, $bar]);