PHP code example of thiagosv / controller-pdo

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

    

thiagosv / controller-pdo example snippets

sh


agoSV\ControllerPDO\Read;

$Read->read("table", "WHERE column1 = :param AND column2 = :param2", "param=value&param2=value2");
$Read->readFull("SELECT * FROM table WHERE column1 = :param AND column2 = :param2", "param=value&param2=value2");

$Read->getResult(); **  **
sh


agoSV\ControllerPDO\Update;

$Update->update("tabela", ['value1' => 'value2'], "WHERE column1 = :param AND column2 = :param2", "param=value&param2=value2");

$Update->getResult(); **  **
sh


agoSV\ControllerPDO\Delete;

$Delete->delete("table", "Query sem select", "param=value&param2=value2");

$Delete->getResult(); **  **
sh


agoSV\ControllerPDO\Create;

$Insert->create("table", ['column1' => 'value1', 'column2' => 'value2']);

$Insert->getResult(); **  **