PHP code example of brunosite / brube-conn

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

    

brunosite / brube-conn example snippets


     
    $data = [
        'column1' => 'value1',
        'column2' => 'value2',
    ]
    
    $create = new Conn\Create();
    $create->run('table_name', $data);

     
    $create = new Conn\Read();
    $create->run('table_name', "WHERE id = :id", "id=1");

     
    $data = [
        'column1' => 'value1',
        'column2' => 'value2',
    ]
    
    $create = new Conn\Update();
    $create->run('table_name', $data, "WHERE id = :id", "id=1");

     
    $create = new Conn\Delete();
    $create->run('table_name', "WHERE id = :id", "id=1");