complete table dump

This commit is contained in:
Marc Delisle
2001-06-07 17:12:04 +00:00
parent 24e7812512
commit 563da00428
2 changed files with 16 additions and 0 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$
$Source$
2001-06-07 Marc Delisle <lem9@users.sourceforge.net>
* modify/implement Steve Alberty's patch for complete table dump
2001-06-06 Armel Fauveau <armel.fauveau@globalis-ms.com>
* patch bookmark section in sql.php3 (bug #430628)

View File

@@ -478,6 +478,19 @@ function get_table_def($db, $table, $crlf)
if(!empty($drop))
$schema_create .= "DROP TABLE IF EXISTS $table;$crlf";
// Steve Alberty's patch for complete table dump,
// modified by Lem9 to allow older MySQL versions to continue to work
if(MYSQL_MAJOR_VERSION == "3.23"){
$result=mysql_query("show create table $db.$table");
if ($result!=false && mysql_num_rows($result)>0){
$tmpres=mysql_fetch_array($result);
$tmp=$tmpres[1];
$schema_create.=str_replace("\n",$crlf,$tmp);
}
return $schema_create;
}
$schema_create .= "CREATE TABLE $table ($crlf";
$result = mysql_query("SHOW FIELDS FROM $db.$table") or mysql_die();