PHP Classes

Only Table backup

Recommend this page to a friend!

      MySQL Dump - database backup  >  All threads  >  Only Table backup  >  (Un) Subscribe thread alerts  
Subject:Only Table backup
Summary:I added a function for table backup
Messages:1
Author:Philipp
Date:2011-11-19 10:16:23
 

  1. Only Table backup   Reply   Report abuse  
Picture of Philipp Philipp - 2011-11-19 10:16:23
If you want to backup only one table (e.g. each time, the table was updated), than you can insert this function and call this instead of doDump


function tableDump($tablename) {
$this->saveToFile($this->file,"SET FOREIGN_KEY_CHECKS = 0;\n\n");
$this->getTableStructure($tablename);
$this->getTableData($tablename,$this->hexValue);
$this->saveToFile($this->file,"SET FOREIGN_KEY_CHECKS = 1;\n\n");
$this->closeFile($this->file);
return true;
}