From da757dcf87fee3b9477ece0becca1eb1a792c042 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Thu, 20 Nov 2003 12:46:53 +0000 Subject: [PATCH] foreach --- libraries/export/sql.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libraries/export/sql.php b/libraries/export/sql.php index 3b50208ae..bfc760dde 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -280,8 +280,7 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm if (isset($comments_map) && count($comments_map) > 0) { $schema_create .= $crlf . '#' . $crlf . '# COMMENTS FOR TABLE ' . PMA_backquote($table, $use_backquotes) . ':' . $crlf; - @reset($comments_map); - while(list($comment_field, $comment) = each($comments_map)) { + foreach($comments_map AS $comment_field => $comment) { $schema_create .= '# ' . PMA_backquote($comment_field, $use_backquotes) . $crlf . '# ' . PMA_backquote($comment, $use_backquotes) . $crlf; } $schema_create .= '#' . $crlf; @@ -290,7 +289,7 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm if (isset($mime_map) && count($mime_map) > 0) { $schema_create .= $crlf . '#' . $crlf . '# MIME TYPES FOR TABLE ' . PMA_backquote($table, $use_backquotes) . ':' . $crlf; @reset($mime_map); - while(list($mime_field, $mime) = each($mime_map)) { + foreach($mime_map AS $mime_field => $mime) { $schema_create .= '# ' . PMA_backquote($mime_field, $use_backquotes) . $crlf . '# ' . PMA_backquote($mime['mimetype'], $use_backquotes) . $crlf; } $schema_create .= '#' . $crlf; @@ -298,8 +297,7 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm if ($have_rel) { $schema_create .= $crlf . '#' . $crlf . '# RELATIONS FOR TABLE ' . PMA_backquote($table, $use_backquotes) . ':' . $crlf; - @reset($res_rel); - while(list($rel_field, $rel) = each($res_rel)) { + foreach($res_rel AS $rel_field => $rel) { $schema_create .= '# ' . PMA_backquote($rel_field, $use_backquotes) . $crlf . '# ' . PMA_backquote($rel['foreign_table'], $use_backquotes) . ' -> ' . PMA_backquote($rel['foreign_field'], $use_backquotes) . $crlf; } $schema_create .= '#' . $crlf;