PHP Classes

Generate Mysqli Backup: Download backup from SQL dump using MySQLi

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 166 All time: 8,896 This week: 455Up
Version License PHP version Categories
mysqlibackup 1.0.0GNU General Publi...5PHP 5, Databases, Systems administration
Description 

Author

This class can download backup from SQL dump using MySQLi.

It can connect to a given database with the user and password of an account and generates SQL statements to restore the database tables and records when the SQL statements are executed.

The generated SQL statements are served as a file for download with a given file name or an automatic name based on the current date and time.

Picture of Vivek moyal
  Performance   Level  
Name: Vivek moyal is available for providing paid consulting. Contact Vivek moyal .
Classes: 7 packages by
Country: India India
Age: ???
All time rank: 35519 in India India
Week rank: 43 Up5 in India India Up
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

Example

<?php
include_once 'backupClass.php';
$backupClass=new backupClass();

$host="localhost";
$user="root";
$password ="";
$dbName="webcam";
$backupName="TestDatabase.sql";
$tables=false; // Backup whole database tables if want specific than comment this line and uncomment the next line
//$tables=array("snapshot"); //backup specific tables only: array("mytable1","mytable2",...)


echo $backupClass->EXPORT_TABLES($host, $user, $pass, $dbName, $tables, $backupName);

?>


Details

mysql-backup

This class will backup whole database or selected tables from the database

For exporting the database as .sql file use this function.

echo $backupClass->EXPORT_TABLES($host, $user, $pass, $dbName, $tables, $backupName);

  Files folder image Files (3)  
File Role Description
Plain text file backupClass.php Class Class source
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:166
This week:0
All time:8,896
This week:455Up