Skip to content

Commit

Permalink
optimize: use high-level function to fetch a single row
Browse files Browse the repository at this point in the history
  • Loading branch information
lem9 committed Jul 16, 2009
1 parent 56defc1 commit 869571e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tbl_replace.php
Expand Up @@ -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) {

Expand Down

0 comments on commit 869571e

Please sign in to comment.