From 57e268f323d7215e2a546abedf061cefcd8a2f5c Mon Sep 17 00:00:00 2001 From: davidecesarano Date: Fri, 18 Jun 2021 12:18:58 +0200 Subject: [PATCH] Update README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1389241..fb4925c 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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.