From 516c7cd68123f36584e4c359edec962f8cde3f5b Mon Sep 17 00:00:00 2001 From: Carlos Barberis Date: Thu, 13 Aug 2009 00:19:20 +0000 Subject: [PATCH] Added quotes to query --- code/submissions/SubmittedFormReportField.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/submissions/SubmittedFormReportField.php b/code/submissions/SubmittedFormReportField.php index 6a091a4..5fb7c2b 100755 --- a/code/submissions/SubmittedFormReportField.php +++ b/code/submissions/SubmittedFormReportField.php @@ -83,9 +83,9 @@ class SubmittedFormReportField extends FormField { // Get the CSV header rows from the database if(defined('Database::USE_ANSI_SQL')) { - $tmp = DB::query("SELECT DISTINCT \"Name\", \"Title\" FROM \"SubmittedFormField\" LEFT JOIN \"SubmittedForm\" ON \"SubmittedForm\".\"ID\" = \"SubmittedFormField\".\"ParentID\" WHERE \"SubmittedFormField\".\"ParentID\" IN (" . implode(',', $inClause) . ") ORDER BY `ID`"); + $tmp = DB::query("SELECT DISTINCT \"Name\", \"Title\" FROM \"SubmittedFormField\" LEFT JOIN \"SubmittedForm\" ON \"SubmittedForm\".\"ID\" = \"SubmittedFormField\".\"ParentID\" WHERE \"SubmittedFormField\".\"ParentID\" IN (" . implode(',', $inClause) . ") ORDER BY \"SubmittedFormField\".\"ID\""); } else { - $tmp = DB::query("SELECT DISTINCT Name, Title FROM SubmittedFormField LEFT JOIN SubmittedForm ON SubmittedForm.ID = SubmittedFormField.ParentID WHERE SubmittedFormField.ParentID IN (" . implode(',', $inClause) . ") ORDER BY SubmittedFormField.ID"); + $tmp = DB::query("SELECT DISTINCT `Name`, `Title` FROM `SubmittedFormField` LEFT JOIN `SubmittedForm` ON `SubmittedForm`.`ID` = `SubmittedFormField`.`ParentID` WHERE `SubmittedFormField`.`ParentID` IN (" . implode(',', $inClause) . ") ORDER BY `SubmittedFormField`.`ID`"); } // Sort the Names and Titles from the database query into separate keyed arrays