You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var _**con**_ (Object) => MySQLi or PDO connection already opened. (N.B. It is recommended that you use the connection to the database inside the class) [READ CON SECTION](#con)
var _**table_name**_ (String or Array) => The tables that you want to backup. [READ TABLE SECTION](#-table_name)
10
11
11
-
var _**con**_(Object) => MySQLi connection already opened.
12
+
var _**ext**_ (_String or Array_) => The extension of the destination file. [READ EXT SECTION](#execute)
12
13
13
-
var _**table_name**_ (String or Array) => The tables that you want to backup. [READ TABLE SECTION](https://github.com/Chak10/Backup-SQL-By-Chak10/blob/master/README.md#-table_name-string-or-array)
14
+
var _**fname**_ (String) => The name of the output file/directory secondary
14
15
15
16
var _**folder**_ (String) => The folder where the files will be saved
16
17
17
-
var _**query_limit**_ (Int) => Number of queries at a time to execute in SQL [READ QUERY LIMIT SECTION](https://github.com/Chak10/Backup-SQL-By-Chak10/blob/master/README.md#query_limit-int)
18
+
var _**query_limit**_ (Int) => Number of queries at a time to execute in SQL [READ QUERY LIMIT SECTION](#query_limit)
18
19
19
-
var _**compress**_ (Bool) => If set to true the result is compressed. (.zip)
20
+
var _**archive**_ (Bool) => It results as an archive. (.zip|.tar)
20
21
21
-
var _**ext**_ (_String or Array_) [NEW VERSION >= V1.0.7] => The extension of the destination file. [READ EXT SECTION](https://github.com/Chak10/Backup_SQL-PHP-ByChak10/blob/master/README.md#ext-string-or-array)
22
+
var _**phpadmin**_(Bool) => If set to true, it creates files that can be imported directly with phpmyadmin. (sql|csv)
22
23
23
-
var _**ext**_ (Int) [OLD VERSION < V1.0.7] => The extension of the destination file. [READ EXT SECTION](https://github.com/Chak10/Backup-SQL-By-Chak10/blob/master/README.md#ext-int)
24
+
var _**save**_ (Bool) => If set to false, the result will not be saved but will be loaded on the variable of class sql, csv, json (Based on request) [READ SAVE SECTION](#save)
24
25
25
-
var _**alltable_in_file**_ (Bool) => If set to true:
26
-
- If the 'compress' variable is true all the files will be saved in a single zip file otherwise all will be saved individually
27
-
- If the 'compress' variable is false all the files will be saved into a single folder (Depending on the extension) or else each file will be saved individually
26
+
var _**sql_unique**_ (Bool) => If set to true the SQL dump is a single file with all the tables. (Valid only for the SQL format)
28
27
29
-
var _**save**_ (Bool) => If set to false, the result will not be saved but will be loaded on the variable of class sql, csv, json (Based on request) [READ SAVE SECTION](https://github.com/Chak10/Backup-SQL-By-Chak10/blob/master/README.md#save-bool)
28
+
var _**down**_ (Bool) => If set to true, the output is automatic downloaded. (zip)
30
29
31
-
var _**sql_unique**_ (Bool) => If set to true the SQL dump is a single file with all the tables. (Valid only for the SQL format)
If set to true it gives a result that can be imported directly with phpmyadmin (sql|csv)
215
250
216
251
```php
217
-
$backup->ext = $backup::SQL;
252
+
$backup->phpmyadmin = true;
218
253
```
219
254
220
-
```php
221
-
$backup->ext = 13;
222
-
```
223
-
- CSV extension
224
255
225
-
```php
226
-
$backup->ext = $backup::CSV;
227
-
```
228
-
229
-
```php
230
-
$backup->ext = 26;
231
-
```
232
-
- JSON extension
233
-
234
-
```php
235
-
$backup->ext = $backup::JSON;
236
-
```
237
-
238
-
```php
239
-
$backup->ext = 49;
240
-
```
241
-
242
-
#### Combinations
243
-
244
-
SQL + CSV
245
-
246
-
```php
247
-
$backup->ext = $backup::SQL + $backup::CSV;
248
-
```
249
-
250
-
```php
251
-
$backup->ext = 13 + 26; // 39
252
-
```
253
-
254
-
```php
255
-
$backup->ext = array($backup::SQL, $backup::CSV);
256
-
```
257
-
258
-
```php
259
-
$backup->ext = array(13,26);
260
-
```
261
-
262
-
```php
263
-
$backup->ext = "39";
264
-
```
265
-
266
-
**Same for JSON and CSV or JSON and SQL**
267
-
268
-
**_For all three formats use ($n > 100)_**
269
-
270
-
> NOTE: If you use the CSV extension, if you want you can add the field delimiter and the enclosure of the camps.
271
-
By default they are:
272
-
- Delimiter => ,
273
-
- Enclosure =>
274
-
275
-
>Example: Data,DATA2,datA3
276
-
277
-
SETTING
278
-
```php
279
-
$backup->del_csv=";";
280
-
$backup->enc_csv="'";
281
-
```
282
-
283
-
### $_alltable_in_file_ (_Bool_)
284
-
285
-
If set to TRUE:
286
-
287
-
- If the 'compress' variable is true all the files will be saved in a single zip file otherwise all will be saved individually.
288
-
289
-
- If the 'compress' variable is false all the files will be saved into a single folder (Depending on the extension. Example Choose SQL extension dir/sql/name_file) or else each file will be saved individually.
290
-
291
-
```php
292
-
$backup->alltable_in_file = true;
293
-
```
294
-
295
-
296
-
### $_save_ (_Bool_)
256
+
### $_save_
297
257
298
258
If set to FALSE, the result will not be saved but will be loaded on the variable of Class sql, csv, json (**ARRAY**)
299
259
300
260
EXAMPLE
301
261
302
-
SQL:
303
-
304
-
object(SQL_Backup)[1]
262
+
JSON:
305
263
306
-
...
307
-
public 'sql' =>
308
-
array (size=1)
309
-
'name_table' => string '...'
310
-
264
+
```txt
265
+
array (size=1)
266
+
'json' =>
267
+
array (size=1)
268
+
'airports' => string '[{"id":"6523","ident":"00A","type":"heliport","name":"Total Rf Heliport","latitude_deg":"40.07080078125","longitude_deg":"-74.93360137939453","elevation_ft":"11","continent":"NA","iso_country":"US","iso_region":"US-PA","municipality":"Bensalem","scheduled_service":"no","gps_code":"00A","iata_code":"","local_code":"00A","home_link":"","wikipedia_link":"","keywords":""},{"id":"323361","ident":"00AA","type":"small_airport","name":"Aero B Ranch Airport","latitude_deg":"38.704022","longitude_deg":"-101.473911","'... (length=20358868)
269
+
```
311
270
312
-
### $_sql_unique_(_Bool_)
271
+
### $_sql_unique_
313
272
314
273
If set to true the SQL dump is a single file with all the tables. (Valid only for the SQL format)
315
274
316
275
> Table 1 SQL + Table 2 SQL + ETC.
317
276
318
-
## In V 1.0.5
319
-
320
-
Added:
277
+
### $_json_option_
321
278
322
-
### $_close_ (_Bool_)
279
+
The classic options that can be used with json_encode.
323
280
324
-
If set to true, at the end of operations the MySQL connection is closed otherwise the connection will be allowed in the class.
0 commit comments