Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
davidecesarano committed Jun 18, 2021
1 parent 4370a12 commit 57e268f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,10 @@ The `values` method binds a value to a parameter. Binds a value to a correspondi

### Pagination
Pagination means displaying all your fetched results in multiple pages instead of showing them all on one page.
To change the page number use `page` query param in URI (`http://example.com/?page=1`).
```php
$current_page = 1;
$perPage = 15;
$users = $pdo->table("users")->paginate($current_page, $perPage);
$users = $pdo->table("users")->paginate($perPage);
```
We will have this result:
```json
Expand All @@ -401,10 +401,9 @@ We will have this result:
```
If you want retrieve specific fields from records you may use:
```php
$current_page = 1;
$perPage = 15;
$fields = 'id, first_name, last_name';
$users = $pdo->table("users")->paginate($current_page, $perPage, $fields);
$users = $pdo->table("users")->paginate($perPage, $fields);
```
### Security
Embryo PDO uses **PDO parameter binding** to protect your application against SQL injection attacks. There is no need to clean strings being passed as bindings.
Expand Down

0 comments on commit 57e268f

Please sign in to comment.