File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ if($insert > 0 ) {
132
132
Every method which executes a query has the optional parameter called bindings.
133
133
134
134
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.
136
136
137
137
Here an example :
138
138
@@ -216,6 +216,7 @@ $person->Firstname = "Nhoj";
216
216
$person->Age = "20";
217
217
$person->Sex = "F";
218
218
$person->Id = "4";
219
+ // Returns affected rows
219
220
$saved = $person->Save();
220
221
221
222
// Or give the bindings to the constructor
@@ -230,13 +231,16 @@ $saved = $person->Save();
230
231
<?php
231
232
// Find person
232
233
$person->Id = "1";
233
- $person = $person->Find();
234
+ $person->Find();
235
+
236
+ echo $person->firstname;
237
+ // Johny
234
238
235
239
// Shorthand method, give id as parameter
236
- $person = $person ->Find(1);
240
+ $person->Find(1);
237
241
238
242
// SQL Equivalent
239
- "SELECT * FROM persons WHERE Id= 1"
243
+ "SELECT * FROM persons WHERE Id = 1"
240
244
```
241
245
#### Getting all the persons
242
246
``` php
You can’t perform that action at this time.
0 commit comments