Skip to content

Commit 8f84284

Browse files
author
Radovan Janjic
committed
Update README.md
1 parent fe11969 commit 8f84284

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -183,29 +183,6 @@ while ($row = $result->fetch_assoc()) {
183183
$db->close();
184184
```
185185

186-
*Prepared statements (works only with MySQLi!)*
187-
```php
188-
$db = new MySQL_wrapper(MySQL_HOST, MySQL_USER, MySQL_PASS, MySQL_DB);
189-
190-
// Connect
191-
$db->connect();
192-
193-
// Fetch query to array
194-
$array = $db->fetchQueryToArray('SELECT * FROM `table`');
195-
196-
// Print array
197-
print_r($array);
198-
199-
// Returns only first row
200-
$array = $db->fetchQueryToArray('SELECT * FROM `table`', TRUE);
201-
202-
// Print array
203-
print_r($array);
204-
205-
// Close connection
206-
$db->close();
207-
```
208-
209186
*Prepared statements (works only with MySQLi!) - if mysqlnd driver is not installed*
210187
```php
211188
$db = new MySQL_wrapper(MySQL_HOST, MySQL_USER, MySQL_PASS, MySQL_DB);
@@ -235,6 +212,29 @@ print_r($data);
235212
$db->close();
236213
```
237214

215+
*Fetch query to array*
216+
```php
217+
$db = new MySQL_wrapper(MySQL_HOST, MySQL_USER, MySQL_PASS, MySQL_DB);
218+
219+
// Connect
220+
$db->connect();
221+
222+
// Fetch query to array
223+
$array = $db->fetchQueryToArray('SELECT * FROM `table`');
224+
225+
// Print array
226+
print_r($array);
227+
228+
// Returns only first row
229+
$array = $db->fetchQueryToArray('SELECT * FROM `table`', TRUE);
230+
231+
// Print array
232+
print_r($array);
233+
234+
// Close connection
235+
$db->close();
236+
```
237+
238238
*Multi results*
239239
```php
240240
$db = new MySQL_wrapper(MySQL_HOST, MySQL_USER, MySQL_PASS, MySQL_DB);

0 commit comments

Comments
 (0)