PHP code example of devbr / database

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

    

devbr / database example snippets


$cfg = [];

$db = new Devbr\Database($cfg);
print_r($db->query('SELECT * FROM TABELA'));

$db = new Devbr\Database;

$db->query('SELECT * FROM TABELA');

print_r($db->result());

//Passando arqumentos:
$args = [':id'=>23];

$db->query('SELECT * FROM TABELA WHERE ID=:id', $args);

print_r($db->result());