From e10351043e7b6bda318a519e191b890cbd392ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Fri, 3 Aug 2001 14:01:32 +0000 Subject: [PATCH] Fixed a possible mysql error --- tbl_copy.php3 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tbl_copy.php3 b/tbl_copy.php3 index 90751ff0a..9b44122f8 100755 --- a/tbl_copy.php3 +++ b/tbl_copy.php3 @@ -1,6 +1,7 @@ do the work */ @@ -45,7 +47,6 @@ if (isset($new_name) && trim($new_name) != '') { $sql_structure = get_table_def($db, $table, "\n"); $sql_structure = ereg_replace('^CREATE TABLE (`?)' . $table . '(`?)', 'CREATE TABLE ' . backquote($new_name), $sql_structure); $result = mysql_query($sql_structure) or mysql_die(); - if (isset($sql_query)) { $sql_query .= "\n" . $sql_structure . ';'; } else { @@ -53,7 +54,7 @@ if (isset($new_name) && trim($new_name) != '') { } // Copy the data - if ($what == 'data') { + if ($result != FALSE && $what == 'data') { // speedup copy table - staybyte - 22. Juni 2001 if (MYSQL_MAJOR_VERSION >= 3.23) { $sql_insert_data = 'INSERT INTO ' . backquote($new_name) . ' SELECT * FROM ' . backquote($table); @@ -75,7 +76,6 @@ if (isset($new_name) && trim($new_name) != '') { * No new name for the table! */ else { -// include('./header.inc.php3'); mysql_die($strTableEmpty); }