PHP code example of hypnokizer / database

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

    

hypnokizer / database example snippets


define('DBPATH', '../app/database/');
define('DB', 'chinook.db');


$attr = array(
    'dbpath' => DBPATH,
    'db' => DB
);

$db = new db($attr);

$query = 'SELECT * FROM thetable WHERE id = ? OR name = ?';

$data = array(3, 'Nathan');

$db->run($query, $data);


foreach($db->results as $row) {
    echo $row['fieldname'];
}

$db->run($query, $data);

$db->createCSV('myfilename.csv');