Código PHP:
Otros temas para dumpear son Ver original
<?php # % -> esta línea la pueden quitar es para evitar un error con el highlight function setQuery($setSelectQueryStr, $fetchType = NULL){ try{ $db = new PDO('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASS); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $pdoQuery = $db->query($setSelectQueryStr); }catch(PDOException $e){ echo $e->getMessage(); exit; } return $arr; } $drop = true; $query = setQuery('SHOW TABLES FROM `' . DB_NAME . '`', PDO::FETCH_NUM); foreach($query as $row){ $tables[] = $row[0]; } $extra['dumpVersion'] = "1.0"; $extra['serverVersion'] = $db->getAttribute(PDO::ATTR_SERVER_VERSION); $extra['dbName'] = DB_NAME; foreach($tables as $k => $v){ $t[] = "[$k] => $v;"; } $text = <<<HEADERTEXT -- dumpFDW -- version {$extra['dumpVersion']} -- http://www.forosdelweb.com/miembros/abimaelrc/ -- -- Host: {$_SERVER['HTTP_HOST']} -- Generation Time: {$extra['dtTm']} -- Server version: {$extra['serverVersion']} -- PHP Version: {$extra['phpVersion']} -- Database: '{$extra['dbName']}' -- Tables: {$extra['tables']} HEADERTEXT; foreach ($tables as $table){ $query = setQuery("SHOW CREATE TABLE `$table`", PDO::FETCH_NUM); foreach($query as $row){ foreach($arr as $key => $value){ } } } } } $query = setQuery("SELECT * FROM `$table`"); $n = 0; foreach($query as $qry){ foreach($columnas as $columna){ $keys[] = "`".$columna."`"; $values[] = $qry[$columna]; } else{ $values[] = "'" . str_replace(array("'", NL), array("''", '\r\n'), addcslashes($qry[$columna], '\\')) . "'"; } } /* $sC = special Char, saber cual cáracter especial colocar al final del código */ $sC = ($n%2000 == 1999 || $n == $nR ? ";" : ","); if($n%2000 == 0){ }else{ } $n++; } } }
http://www.forosdelweb.com/f18/backu...o-1-0b-166532/
y http://www.forosdelweb.com/f54/tutor...igdump-376908/
Nota:
12-29-2010 Se quito la clase singleton, no es útil para base de datos.