PHP code example of emma / dbal
1. Go to this page and download the library: Download emma/dbal 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/ */
emma / dbal example snippets
$connection = ConnectionManager::createConnection([
"host" => "localhost",
"username" => "root",
"password" => "",
"dbname" => "mytest",
"port" => 3306,
"driver" => \Emma\Dbal\Connection\Drivers::MYSQL
]);
$sqlQuery = new Query();
$sqlQuery->QB()->delete()->from("table");
$criteria = []; //KeyValue pair
$dataTypes = []; //Optional
$sqlQuery = CriteriaHandler::handle($sqlQuery, $criteria, $dataTypes);
$sqlQuery->execute();