PHP code example of qpdb / query-builder
1. Go to this page and download the library: Download qpdb/query-builder 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/ */
qpdb / query-builder example snippets
use Qpdb\QueryBuilder\QueryBuild;
$query = QueryBuild::select( 'employees' )
->fields('lastName, jobTitle, officeCode')
->whereEqual( 'jobTitle', "Sales Rep" )
->whereIn( 'officeCode', [ 2, 3, 4 ] );
$query->execute() /** return array */
Array
(
[0] => Array
(
[lastName] => Firrelli
[jobTitle] => Sales Rep
[officeCode] => 2
)
[1] => Array
(
[lastName] => Patterson
[jobTitle] => Sales Rep
[officeCode] => 2
)
...
)