File: Example.php

Recommend this page to a friend!
  Classes of Raul  >  DB Backup Class  >  Example.php  >  Download  
File: Example.php
Role: Example script
Content type: text/plain
Description: Example
Class: DB Backup Class
Generate a MySQL database backup using PDO
Author: By
Last change:
Date: 10 years ago
Size: 537 bytes



Class file image Download
include 'DBBackup.class.php';
$db = new DBBackup(array(
'driver' => 'mysql',
'host' => '',
'user' => 'root',
'password' => '',
'database' => 'teste_backup'
$backup = $db->backup();
// If there isn't errors, show the content
    // The backup will be at $var['msg']
    // You can do everything you want to. Like save in a file.
    // $fp = fopen('file.sql', 'a+');fwrite($fp, $backup['msg']);fclose($fp);
echo nl2br($backup['msg']);
} else {
'An error has ocurred.';

For more information send a message to info at phpclasses dot org.