PHP code example of zonuexe / tetosql

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

    

zonuexe / tetosql example snippets

 php


namespace MyApp;

use Teto\SQL\Query;

$conn = new \PDO('sqlite:/tmp/db.sq3', null, null, [\PDO::ATTR_PERSISTENT => true]);
$data = Query::execute(
    $conn,
    <<<'SQL'
        SELECT * FROM `users`
        WHERE `status` IN (:statuses@int[])
        LIMIT :offset@int, :limit@int
    SQL,
    [
        ':statuses' => [1, 3],
        ':offset'   => 60,
        ':limit'    => 30,
    ]
)->fetch(\PDO::FETCH_ASSOC);