Query Builder
Example Usage
# in config.php you can add the ff:
$config = [
// DATABASE
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'test',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'prefix' => ''
// ...
];
$records = database()->table('users')
->select('id, name, surname, age')
->where('age', '>', 18)
->orderBy('id', 'desc')
->limit(20)
->getAll();
dd($records);Detailed Usage and Methods
config
Contents
Methods
select
select functions (min, max, sum, avg, count)
table
get AND getAll
join
where
grouped
in
findInSet
between
like
groupBy
having
orderBy
limit - offset
pagination
insert
update
delete
transaction
analyze
check
checksum
optimize
repair
query
insertId
numRows
error
cache
queryCount
getQuery
Last updated