PHP code example of ntentan / atiaa

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

    

ntentan / atiaa example snippets




// Connect to a database
$factory = new \ntentan\atiaa\DriverFactory(
    array(
        'driver' => 'mysql',
        'user' => 'root',
        'password' => 'rootpassy',
        'host' => 'localhost',
        'dbname' => 'somedb'
    )
);
$atiaa = $factory->createDriver();

// Perform some queries
$data = $atiaa->query('SELECT * FROM some_table');
$data2 = $atiaa->query(
    'SELECT * FROM some_other_table WHERE id = ? and an_item = ?', 
    array(2, 'something')
);

// Get the description of the database
$description = $atiaa->describe();
var_dump($description);

// Perform a query while quoting the literals.
$data3 = $atiaa->quoteQuery('SELECT "First Name" from "Users Table" ');