Generate better query for multi row export.

This commit is contained in:
Michal Čihař
2004-05-13 17:32:34 +00:00
parent f3b23709e9
commit 78d646e4ee
2 changed files with 4 additions and 11 deletions

View File

@@ -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 <lem9@users.sourceforge.net>
* db_details_structure.php: bug #951143, undefined $header_url_qry

View File

@@ -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'];