PHP code example of hybridlogic / db-querybuilder

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

    

hybridlogic / db-querybuilder example snippets


$sql = Query::select(array('m.name', 'movie'), array('t.name', 'theatre_name'), 'visited_date')
	->from(array('visits', 'v'))
	->join(array('movies', 'm'))->on('v.movie_id', '=', 'm.id')
	->join(array('theatres', 't'))->on('v.theatre_id', '=', 't.id')
	->where('m.rating', '>=', 80)
	->order_by('v.visited_date', 'DESC')
	->limit(5)
	->as_object('MovieVisit')
	->sql();