Skip to content

Commit ba3a785

Browse files
author
Indieteq
committed
Update README.md
1 parent 2fedec8 commit ba3a785

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ if($insert > 0 ) {
132132
Every method which executes a query has the optional parameter called bindings.
133133

134134
The <i>row</i> and the <i>query</i> method have a third optional parameter which is the fetch style.
135-
The default fetch style is PDO::FETCH_ASSOC which returns an associative array.
135+
The default fetch style is <i>PDO::FETCH_ASSOC</i> which returns an associative array.
136136

137137
Here an example :
138138

@@ -216,6 +216,7 @@ $person->Firstname = "Nhoj";
216216
$person->Age = "20";
217217
$person->Sex = "F";
218218
$person->Id = "4";
219+
// Returns affected rows
219220
$saved = $person->Save();
220221

221222
// Or give the bindings to the constructor
@@ -230,13 +231,16 @@ $saved = $person->Save();
230231
<?php
231232
// Find person
232233
$person->Id = "1";
233-
$person = $person->Find();
234+
$person->Find();
235+
236+
echo $person->firstname;
237+
// Johny
234238

235239
// Shorthand method, give id as parameter
236-
$person = $person->Find(1);
240+
$person->Find(1);
237241

238242
// SQL Equivalent
239-
"SELECT * FROM persons WHERE Id= 1"
243+
"SELECT * FROM persons WHERE Id = 1"
240244
```
241245
#### Getting all the persons
242246
```php

0 commit comments

Comments
 (0)