optimize: use high-level function to fetch a single row

This commit is contained in:
Marc Delisle
2009-07-16 12:21:21 +00:00
parent 56defc1153
commit 869571ee16

View File

@@ -215,13 +215,8 @@ foreach ($loop_array as $rowcount => $primary_key) {
// Fetch the current values of a row to use in case we have a protected field // 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 // @todo possibly move to ./libraries/tbl_replace_fields.inc.php
if ($is_insert && $using_key && isset($me_fields_type) && if ($is_insert && $using_key && isset($me_fields_type) && is_array($me_fields_type) && isset($primary_key)) {
is_array($me_fields_type) && isset($primary_key)) { $prot_row = PMA_DBI_fetch_single_row('SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $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);
} }
foreach ($me_fields as $key => $val) { foreach ($me_fields as $key => $val) {