PHP code example of dbutil / crud

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

    

dbutil / crud example snippets


$connection = new PDO(
    'mysql:host=localhost;dbname=agent_atw',
    'root',
    '123456'
);

$crud = new Crud($connection);

$selectUsers = "SELECT * FROM users WHERE ic_status = true ORDER BY dt_

$data = array(
    "nm_user" => "ElicX2",
    "nm_email" => "[email protected]",
    "nm_password" => "123456"
);

$table = "users";

$columnsThatWillBeFilled = array(
    "nm_user",
    "nm_email",
    "nm_password",
);

$saved = $crud->saveData($data, $table, $columnsThatWillBeFilled);

$data = array(
    "nm_user" => "Lic",
    "nm_email" => "[email protected]",
);

$table = "users";

$where = "WHERE id_user = 4 AND ic_status = true";

$updated = $crud->updateData($data, $table, $where);

$table = "users";

$where = "WHERE id_user = 4 AND ic_status = true";

$deleted = $crud->deleteData($table, $where);