From 869571ee1665778f9b6d6fa016a558e54c426e95 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 16 Jul 2009 12:21:21 +0000 Subject: [PATCH] optimize: use high-level function to fetch a single row --- tbl_replace.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tbl_replace.php b/tbl_replace.php index e41ee12db015..a36ec7fce938 100644 --- a/tbl_replace.php +++ b/tbl_replace.php @@ -215,13 +215,8 @@ // Fetch the current values of a row to use in case we have a protected field // @todo possibly move to ./libraries/tbl_replace_fields.inc.php - if ($is_insert && $using_key && isset($me_fields_type) && - is_array($me_fields_type) && isset($primary_key)) { - $prot_result = PMA_DBI_query('SELECT * FROM ' . - PMA_backquote($table) . ' WHERE ' . $primary_key . ';'); - $prot_row = PMA_DBI_fetch_assoc($prot_result); - PMA_DBI_free_result($prot_result); - unset($prot_result); + if ($is_insert && $using_key && isset($me_fields_type) && is_array($me_fields_type) && isset($primary_key)) { + $prot_row = PMA_DBI_fetch_single_row('SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $primary_key . ';'); } foreach ($me_fields as $key => $val) {