View Issue Details

This bug affects 1 person(s).
 0
IDProjectCategoryView StatusLast Update
03583Bug reportsInstallationpublic2009-08-19 00:55
Reporteruser4284Assigned Touser372 
PrioritynormalSeveritypartial_block 
Status closedResolutionduplicate 
Product Version1.85+ 
Summary03583: SQL error when activating a survey
Description

The syntax of the SQL command was wrong - the Group By clause should be last. The part after that belongs to the Where clause. Also, you need to specify an aggregate function in you select if you are using Group By.

In the activate.php script, I changed the line

$groupquery = "SELECT g.gid,g.group_name,count(q.qid) as count from {$dbprefix}questions as q RIGHT JOIN {$dbprefix}groups as g ON q.gid=g.gid WHERE g.sid=$postsid group by g.gid AND g.language='$baselang' AND q.language='$baselang';";

to

$groupquery = "SELECT min(g.gid),min(g.group_name),count(q.qid) as count from {$dbprefix}questions as q RIGHT JOIN {$dbprefix}groups as g ON q.gid=g.gid WHERE g.sid=$postsid AND g.language='$baselang' AND q.language='$baselang' group by g.gid ;";

This worked and I could activate the survey.

TagsNo tags attached.
Bug heat0
Complete LimeSurvey version number (& build)
I will donate to the project if issue is resolved
Browser
Database type & versionSQL Server 2005
Server OS (if known)Windows Server 2003
Webserver software & version (if known)IIS 6
PHP Version5.3.0

Relationships

duplicate of 03494 closedjcleeland MS SQL syntax error upon survey activation attempt 

Users monitoring this issue

There are no users monitoring this issue.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2009-08-18 17:03 user4284 New Issue
2009-08-18 17:03 user4284 Status new => assigned
2009-08-18 17:03 user4284 Assigned To => user372
2009-08-18 17:03 user4284 Database & DB-Version => SQL Server 2005
2009-08-18 17:03 user4284 Operating System (Server) => Windows Server 2003
2009-08-18 17:03 user4284 Webserver => IIS 6
2009-08-18 17:03 user4284 PHP Version => 5.3.0
2009-08-19 00:55 c_schmitz Status assigned => closed
2009-08-19 00:55 c_schmitz Resolution open => duplicate
2009-08-19 00:55 c_schmitz Relationship added duplicate of 03494