PHP code example of primal / query
1. Go to this page and download the library: Download primal/query 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/ */
primal / query example snippets
$q=Primal\Query\MySQL::Make($pdo) //$pdo contains your PDO link object
->from('users','u')
->leftJoin("user_billing b USING (user_id)")
->orderBy('u.name')
->returns('u.id', 'u.name', 'b.start_date')
->whereTrue('b.active')
->whereDateInRange('b.start_date', new DateTime('yesterday'));
$results = $q->select();