Anonymous Login
2016-10-23 20:03 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
04894Bug reports[All Projects] Response browsingpublic2011-01-26 22:10
Assigned ToDenisChenu 
Product Version1.91RC2 
Target VersionFixed in Version1.91RC3 
Summary04894: Changing "display" to "Completed responses only" = SQL syntax error
DescriptionAs per the summary. Admin cannot proceed once this issue is triggered.
Steps To Reproduce1) Go to browse a survey's responses
2) Change display to "completed responses only"
3) System fails with an SQL error that's not recoverable:

Couldn't pull response data
SELECT count(*) FROM `lime_survey_18513` submitdate IS NOT NULL
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS NOT NULL' at line 1
Additional InformationI fixed it by adding a line to admin/browse.php:

$sql_where = "";
if (incompleteAnsFilterstate() == "inc")
  $sql_where .= "submitdate IS NULL";
elseif (incompleteAnsFilterstate() == "filter")
  $sql_where .= "submitdate IS NOT NULL";

// SM 22Jan11: Fix to add WHERE clause if needed.
if($sql_where != "") { $sql_where = "WHERE ".$sql_where; }

$dtquery = "SELECT count(*) FROM $sql_from $sql_where";

$dtresult=db_execute_num($dtquery) or safe_die("Couldn't pull response data

I generally prefer generating sql in more robust methods, but that's my quick fix.
TagsNo tags attached.
Complete LimeSurvey version number (& build)191
I will donate to the project if issue is resolvedNo
BrowserFirefox, Chrome
Database & DB-VersionMySQL5
Operating System (Server)Ubuntu 10.04
Webserver software & versionApache2
PHP VersionPHP5
Attached Files

related to 04929closedlemeur crash by pressing "show answers" in "answers and statistics" 



starmonkey (reporter)

Note the build is Version 1.91RC2 Build 9672 (latest download)


DenisChenu (developer)

Thanks !

Fixed with:
    if ($sql_where!="")
        $dtquery .=" WHERE $sql_where";



c_schmitz (administrator)


-Issue History
Date Modified Username Field Change
2011-01-22 08:47 starmonkey New Issue
2011-01-22 09:12 starmonkey Note Added: 13954
2011-01-22 18:55 DenisChenu Assigned To => DenisChenu
2011-01-22 18:55 DenisChenu Status new => assigned
2011-01-22 18:58 DenisChenu Note Added: 13956
2011-01-22 18:58 DenisChenu Status assigned => resolved
2011-01-22 18:58 DenisChenu Fixed in Version => 1.91RC3
2011-01-22 18:58 DenisChenu Resolution open => fixed
2011-01-22 19:01 DenisChenu Note Deleted: 13956
2011-01-22 19:01 DenisChenu Note Added: 13957
2011-01-26 22:10 c_schmitz Note Added: 13968
2011-01-26 22:10 c_schmitz Status resolved => closed
2011-03-01 11:58 DenisChenu Relationship added related to 04929
+Issue History