1
- # slvler - php-mysql-connectors
1
+ # php-mysql-connectors
2
2
3
3
[ ![ tests] ( https://github.com/slvler/php-mysql-connectors/actions/workflows/tests.yml/badge.svg )] ( https://github.com/slvler/php-mysql-connectors )
4
- [ ![ Latest Stable Version] ( http ://poser.pugx.org/slvler/mysql-connectors/v)] ( https://packagist.org/packages/slvler/mysql-connectors )
5
- [ ![ Latest Unstable Version] ( http ://poser.pugx.org/slvler/mysql-connectors/v/unstable)] ( https://packagist.org/packages/slvler/mysql-connectors )
6
- [ ![ License] ( http ://poser.pugx.org/slvler/mysql-connectors/license)] ( https://packagist.org/packages/slvler/mysql-connectors )
7
-
4
+ [ ![ Latest Stable Version] ( https ://poser.pugx.org/slvler/mysql-connectors/v)] ( https://packagist.org/packages/slvler/mysql-connectors )
5
+ [ ![ Latest Unstable Version] ( https ://poser.pugx.org/slvler/mysql-connectors/v/unstable)] ( https://packagist.org/packages/slvler/mysql-connectors )
6
+ [ ![ License] ( https ://poser.pugx.org/slvler/mysql-connectors/license)] ( https://packagist.org/packages/slvler/mysql-connectors )
7
+ [ ![ Total Downloads ] ( https://poser.pugx.org/slvler/mysql-connectors/downloads )] ( https://packagist.org/packages/slvler/mysql-connectors )
8
8
9
9
Mysql driver development that can be used on the php side
10
10
11
-
12
11
## Installation
13
12
14
13
To install this package tou can use composer:
15
14
16
15
``` bash
17
- composer require slvler/mysql-connectors
16
+ composer require slvler/mysql-connectors
18
17
```
19
-
20
18
## Usage
21
19
22
20
``` php
23
-
24
21
use slvler\mysqlconnectors\Constant;
25
22
use slvler\mysqlconnectors\Config\Method;
26
23
use slvler\mysqlconnectors\Database\DatabaseController;
27
24
28
-
29
25
$Constant = new Constant();
30
26
31
27
$db = new DatabaseController($Constant->showDBHost(), $Constant->showDBName(), $Constant->showDBUser(), $Constant->showDBPassword(), $Constant->showConnection());
32
28
33
29
```
34
30
35
-
36
-
37
31
Basic Table // use northwind
38
32
------------
39
33
@@ -49,7 +43,6 @@ Basic Table // use northwind
49
43
50
44
51
45
52
-
53
46
#### Insert Method (TableName, Data = array()):
54
47
55
48
TableName, Data:
@@ -64,21 +57,12 @@ $data = Array
64
57
"ShipCity" => "UK"
65
58
);
66
59
```
67
-
68
-
69
60
### Insert Method
70
-
71
-
72
61
``` php
73
-
74
62
$methodInsert = $method->Insert($tableName,$data);
75
-
76
63
```
77
-
78
64
#### Update Method (TableName, Id = array() , Data = array()):
79
-
80
65
TableName, Id , Data:
81
-
82
66
``` php
83
67
$tableName = "Orders";
84
68
@@ -95,15 +79,11 @@ $data = Array
95
79
```
96
80
97
81
### Update Method
98
-
99
82
``` php
100
-
101
83
$methodUpdate = $method->Update($tableName', $id, $data);
102
-
103
84
```
104
85
105
86
### Delete Method (TableName, Id = array()):
106
-
107
87
TableName, Id:
108
88
109
89
``` php
@@ -114,38 +94,20 @@ $Id = array(
114
94
);
115
95
116
96
```
117
-
118
97
### Delete Method
119
-
120
98
``` php
121
-
122
99
$methodDelete = $method->Delete($tableName,$id);
123
-
124
100
```
125
-
126
-
127
-
128
101
### Select_all Method (TableName):
129
-
130
102
TableName:
131
-
132
103
``` php
133
104
$tableName = "Orders";
134
105
```
135
-
136
106
### Select_all Method
137
-
138
107
``` php
139
-
140
108
$methodSelectAll = $method->Select_all($tableName);
141
-
142
109
```
143
-
144
-
145
-
146
-
147
110
### Select_ch Method (TableName, Data = array()):
148
-
149
111
TableName, Data:
150
112
151
113
``` php
@@ -157,62 +119,38 @@ $data = Array
157
119
);
158
120
159
121
```
160
-
161
122
### Select_ch Method
162
-
163
123
``` php
164
-
165
124
$methodSelectCh = $method->Select_ch($tableName,$data);
166
-
167
125
```
168
-
169
-
170
126
#### Select_wh Method (TableName, Data = array(), Conn = array(), If = array()):
171
-
172
127
TableName, Data, Conn, If:
173
-
174
128
``` php
175
129
$tableName = "Orders";
176
-
177
130
$data = Array
178
131
(
179
132
"EmployeeID" => "4"
180
133
);
181
-
182
134
$conn = Array
183
135
(
184
136
"!="
185
137
);
186
-
187
138
$if = Array
188
139
(
189
140
"AND"
190
141
);
191
-
192
142
```
193
-
194
-
195
143
### Select_wh Method
196
-
197
144
``` php
198
-
199
145
$methodSelectWh = $method->Select_wh($tableName, $data, $conn, $if);
200
-
201
146
```
202
-
203
-
204
-
205
147
### Testing
206
148
207
149
``` bash
208
150
vendor\b in\p hpunit
209
151
```
210
-
211
152
## Credits
212
-
213
- - [ slvler] ( https://github.com/slvler )
214
-
153
+ - [ slvler] ( https://github.com/slvler )
215
154
216
155
## License
217
-
218
156
The MIT License (MIT). Please see [ License File] ( https://github.com/slvler/slvler/blob/main/LICENSE.md ) for more information.
0 commit comments