Skip to content

Commit

Permalink
Fixed Issue #04180: Add group to a survey.
Browse files Browse the repository at this point in the history
Added a workaround to compensate for MSSQL server express 2005's inability to save multiple rows of a table in a single insert statement using comma separated value sets.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@8512 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Amit Shanker committed Mar 23, 2010
1 parent 93d6e8b commit c203d8a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions admin/html.php
Expand Up @@ -1628,10 +1628,18 @@
{
$uid_arr[] = $row2['uid'];
$values[] = "($surveyid, {$row2['uid']},0,0,0,0,0,0)";
}
$values_implode = implode(",", $values);
$values_mssql[] = " $surveyid, {$row2['uid']},0,0,0,0,0,0 ";
}
if ($databasetype == 'odbc_mssql' && count($values_mssql) > 1) {
$isrquery = "INSERT INTO {$dbprefix}surveys_rights SELECT ";
$values_implode = implode(" UNION ALL SELECT ", $values_mssql);
$isrquery .= $values_implode;
}
else {
$values_implode = implode(",", $values);
$isrquery = "INSERT INTO {$dbprefix}surveys_rights VALUES ".$values_implode;
}

$isrquery = "INSERT INTO {$dbprefix}surveys_rights VALUES ".$values_implode;
$isrresult = $connect->Execute($isrquery); //Checked

if($isrresult)
Expand Down

0 comments on commit c203d8a

Please sign in to comment.