forked from izniburak/pdox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.php
37 lines (31 loc) · 772 Bytes
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/*
*
* @ Package: PDOx - Useful Query Builder & PDO Class
* @ Author: izni burak demirtas / @izniburak <info@burakdemirtas.org>
* @ Web: http://burakdemirtas.org
* @ URL: https://github.com/izniburak/PDOx
* @ Licence: The MIT License (MIT) - Copyright (c) - http://opensource.org/licenses/MIT
*
*/
require 'vendor/autoload.php';
// database config
$config = [
'host' => 'localhost',
'driver' => 'mysql',
'database' => 'test',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'prefix' => ''
];
// start PDOx
$db = new \Buki\Pdox($config);
// Select Records
$records = $db->table('pages')
->where('age', '>', 18)
->orderBy('id', 'desc')
->limit(10)
->getAll();
var_dump($records);