File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -275,16 +275,19 @@ print_r ($products);
275275
276276### Properties sharing
277277Its is also possible to copy properties
278+
279+ Simple pagination example:
278280``` php
279281$db->where ("agentId", 10);
282+ $db->where ("active", true);
280283
281284$customers = $db->copy ();
282- $res = $customers->get ("customers");
283- // SELECT * FROM customers where agentId = 10
285+ $res = $customers->get ("customers", Array (10, 10) );
286+ // SELECT * FROM customers where agentId = 10 and active = 1 limit 10, 10
284287
285- $db->orWhere ("agentId ", 20 );
286- $res = $db->get ("users") ;
287- // SELECT * FROM users where agentId = 10 or agentId = 20
288+ $res = $ db->getOne ("customers ", "count(id) as cnt" );
289+ echo "total records found: " . $res['cnt'] ;
290+ // SELECT count(id) FROM users where agentId = 10 and active = 1
288291```
289292
290293### Subqueries
You can’t perform that action at this time.
0 commit comments