PHP Classes

Only backing up first Table

Recommend this page to a friend!

      SQL Backup  >  All threads  >  Only backing up first Table  >  (Un) Subscribe thread alerts  
Subject:Only backing up first Table
Summary:Code was only backing up the first table -- here's a fix.
Messages:1
Author:G. Miernicki
Date:2008-04-21 19:41:17
 

  1. Only backing up first Table   Reply   Report abuse  
Picture of G. Miernicki G. Miernicki - 2008-04-21 19:41:20
OLD CODE (class.SQLBackup.php) -- ONLY BACKED UP FIRST TABLE


////////////////////////////////////////////////////////////////
//enumerate tables

$this->m_dbObject->queryConstant('SHOW TABLES;') ;

while ($theTable = $this->m_dbObject->fetchRow()) {
$theTableName = $theTable[0] ;
////////////////////////////////////////////////////////////////







MY REVISION (class.SQLBackup.php) - backs up all tables


////////////////////////////////////////////////////////////////
//enumerate tables

$this->m_dbObject->queryConstant('SHOW TABLES;') ;

$tableList = array();
while ($theTable = $this->m_dbObject->fetchRow()) {
$tableList[] = $theTable[0];
}

foreach ($tableList as $theTableName) {
/////////////////////////////////////////////////////////////////

-Greg