With this method, you can get backup from your database
You can get full backup or backup from specific tables
| Name | Type | Description | Required |
|---|---|---|---|
| wanted_tables | array | null | set if you want specific table which exist | no |
| table_data | bool | set false if you only want the creation queries(no data),default: true | no |
| save | bool | set false if you want to receive sql as string, default: true | no |
| file_name | string | file name for saving | no |
Output : string
Static or normal : Static
/** Get full backup and save it to file */
$file_name = mysql::backup();/** Get backup from users table only */
mysql::backup(['users']);/** Get backup from table structure only(no data) */
mysql::backup(table_data: false);/** Get backup in variable instead of file */
$backup = mysql::backup(save: false);/** Get backup and save it to backup.sql */
mysql::backup(file_name: 'backup.sql');