From 78d646e4ee2aa5f76867225d2c5b25d441f99bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 13 May 2004 17:32:34 +0000 Subject: [PATCH] Generate better query for multi row export. --- ChangeLog | 1 + tbl_properties_export.php | 14 +++----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2badc1cc0..a759d29a6 100755 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,7 @@ $Source$ * lang/czech: Fixed untranslated word (translation #952551). * scripts/create_tables.sql: Cleaned up description, regenerated dump. * tbl_row_delete.php: Highlight correct tab for multi row editing/export. + * tbl_properties_export.php: Generate better query for multi row export. 2004-05-12 Marc Delisle * db_details_structure.php: bug #951143, undefined $header_url_qry diff --git a/tbl_properties_export.php b/tbl_properties_export.php index 6a077054c..b31fb99a4 100644 --- a/tbl_properties_export.php +++ b/tbl_properties_export.php @@ -38,23 +38,15 @@ if (isset($sql_query)) { if (!empty($analyzed_sql[0]['from_clause'])) { $sql_query .= ' FROM ' . $analyzed_sql[0]['from_clause']; } - if (!empty($analyzed_sql[0]['where_clause'])) { - $sql_query .= ' WHERE ' . $analyzed_sql[0]['where_clause']; - } if (isset($primary_key)) { - if (empty($analyzed_sql[0]['where_clause'])) { - $sql_query .= ' WHERE '; - } else { - $sql_query .= ' AND ( '; - } + $sql_query .= ' WHERE '; $conj = ''; foreach($primary_key AS $i => $key) { $sql_query .= $conj . '( ' . $key . ' ) '; $conj = 'OR '; } - if (!empty($analyzed_sql[0]['where_clause'])) { - $sql_query .= ' ) '; - } + } else { + $sql_query .= ' WHERE ' . $analyzed_sql[0]['where_clause']; } if (!empty($analyzed_sql[0]['group_by_clause'])) { $sql_query .= ' GROUP BY ' . $analyzed_sql[0]['group_by_clause'];