PHP Classes

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Daniele  >  MySQL Dump - database backup  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: How to use the class
Class: MySQL Dump - database backup
Dump a MySQL database in a backup file
Author: By
Last change: A new example for new class version.
Date: 8 years ago
Size: 932 bytes


Class file image Download
//MySQL connection parameters
$dbhost = '';
$dbuser = 'root';
$dbpsw = 'root';
$dbname = 'database_1';
//Connects to mysql server
$connessione = @mysql_connect($dbhost,$dbuser,$dbpsw);

//Includes class

//Creates a new instance of MySQLDump: it exports a compressed and base-16 file
$dumper = new MySQLDump($dbname,'filename.sql',true,true);

//Use this for plain text and not compressed file
//$dumper = new MySQLDump($dbname,'filename.sql',false,false);

//Dumps all the database
//Dumps all the database structure only (no data)

//Dumps all the database data only (no structure)

//Dumps "mytable" table structure only (no data)

//Dumps "mytable" table data only (no structure)