make source readable
This commit is contained in:
@@ -17,24 +17,29 @@ function my_handler($sql_insert)
|
||||
}
|
||||
|
||||
if (isset($new_name)) $new_name=trim($new_name); // Cleanup to suppress '' tables
|
||||
if (isset($new_name) && $new_name!=""){
|
||||
$sql_structure = get_table_def($db, $table, "\n");
|
||||
// speedup copy table - staybyte - 22. Juni 2001
|
||||
if(MYSQL_MAJOR_VERSION >= 3.23){
|
||||
$sql_structure = ereg_replace("CREATE TABLE `$table`", "CREATE TABLE `$new_name`", $sql_structure);
|
||||
$result = mysql_query($sql_structure) or mysql_die();
|
||||
if($what == "data"){
|
||||
$query="INSERT INTO $new_name SELECT * FROM $table";
|
||||
$result = mysql_query($query) or mysql_die();
|
||||
}
|
||||
}
|
||||
else{
|
||||
$sql_structure = ereg_replace("CREATE TABLE `$table`", "CREATE TABLE $new_name", $sql_structure);
|
||||
$result = mysql_query($sql_structure) or mysql_die();
|
||||
if ($result!=false && $what == "data"){
|
||||
get_table_content($db, $table, 0, 0, "my_handler");
|
||||
}
|
||||
}
|
||||
if (isset($new_name) && $new_name!="")
|
||||
{
|
||||
$sql_structure = get_table_def($db, $table, "\n");
|
||||
// speedup copy table - staybyte - 22. Juni 2001
|
||||
if(MYSQL_MAJOR_VERSION >= 3.23)
|
||||
{
|
||||
$sql_structure = ereg_replace("CREATE TABLE `$table`", "CREATE TABLE `$new_name`", $sql_structure);
|
||||
$result = mysql_query($sql_structure) or mysql_die();
|
||||
if($result!=false && $what == "data")
|
||||
{
|
||||
$query="INSERT INTO `$new_name` SELECT * FROM `$table`";
|
||||
$result = mysql_query($query) or mysql_die();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql_structure = ereg_replace("CREATE TABLE `$table`", "CREATE TABLE $new_name", $sql_structure);
|
||||
$result = mysql_query($sql_structure) or mysql_die();
|
||||
if ($result!=false && $what == "data")
|
||||
{
|
||||
get_table_content($db, $table, 0, 0, "my_handler");
|
||||
}
|
||||
}
|
||||
}
|
||||
else mysql_die($strTableEmpty);
|
||||
|
||||
|
Reference in New Issue
Block a user