@@ -35,17 +35,12 @@ composer require joshcam/mysqli-database-class:dev-master
3535```
3636
3737### Initialization
38- Simple initialization with utf8 charset by default:
38+ Simple initialization with utf8 charset set by default:
3939``` php
4040$db = new MysqliDb ('host', 'username', 'password', 'databaseName');
4141```
42- Or in case usage of the namespaces:
43- ``` php
44- $db = new \MysqliDb ('host', 'username', 'password', 'databaseName');
45- ```
46-
4742
48- Advanced initialization. If no charset should be set charset, set it to null
43+ Advanced initialization:
4944``` php
5045$db = new MysqliDb (Array (
5146 'host' => 'host',
@@ -56,15 +51,16 @@ $db = new MysqliDb (Array (
5651 'prefix' => 'my_',
5752 'charset' => 'utf8'));
5853```
59- prefix, port and charset params are optional.
54+ table prefix, port and database charset params are optional.
55+ If no charset should be set charset, set it to null
6056
61- Reuse already connected mysqli:
57+ Also it is possible to reuse already connected mysqli object :
6258``` php
6359$mysqli = new mysqli ('host', 'username', 'password', 'databaseName');
6460$db = new MysqliDb ($mysqli);
6561```
6662
67- Its also possible to set a table prefix via separate call:
63+ If no table prefix were set during object creation its possible to set it later with a separate call:
6864``` php
6965$db->setPrefix ('my_');
7066```
@@ -75,17 +71,16 @@ If you need to get already created mysqliDb object from another class or functio
7571 // db staying private here
7672 $db = new MysqliDb ('host', 'username', 'password', 'databaseName');
7773 }
74+ ...
7875 function myfunc () {
7976 // obtain db object created in init ()
8077 $db = MysqliDb::getInstance();
8178 ...
8279 }
8380```
8481
85- Next, prepare your data, and call the necessary methods.
86-
8782### Objects mapping
88- dbObject.php is an object mapping library built on top of mysqliDb to provide model prepresentation functionality.
83+ dbObject.php is an object mapping library built on top of mysqliDb to provide model representation functionality.
8984See <a href =' dbObject.md ' >dbObject manual for more information</a >
9085
9186### Insert Query
@@ -156,9 +151,9 @@ if ($db->update ('users', $data))
156151else
157152 echo 'update failed: ' . $db->getLastError();
158153```
154+
159155### Select Query
160- After any select/get function calls amount or returned rows
161- is stored in $count variable
156+ After any select/get function calls amount or returned rows is stored in $count variable
162157``` php
163158$users = $db->get('users'); //contains an Array of all users
164159$users = $db->get('users', 10); //contains an Array 10 users
@@ -234,7 +229,6 @@ $resutls = $db->rawQuery ($q, $params);
234229print_r ($results); // contains Array of returned rows
235230```
236231
237-
238232### Where Method
239233This method allows you to specify where parameters of the query.
240234
0 commit comments