Skip to content

Commit

Permalink
Fixed retrieving query results
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_yii@11789 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Gaurav Narula committed Dec 28, 2011
1 parent ee1c84d commit df07a4e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions application/helpers/qanda_helper.php
Expand Up @@ -362,12 +362,12 @@ function setman_questionandcode($ia)

$qquery = "SELECT other FROM {{questions}} WHERE qid=".$ia[0]." AND language='".$_SESSION['s_lang']."' and parent_qid=0";
$qresult = db_execute_assoc($qquery); //Checked
$qrow = $qresult->row_array();
$qrow = $qresult->read();
$other = $qrow['other'];
$subquestionquery = "SELECT title FROM {{questions}} WHERE parent_qid={$ia[0]} AND language='".$_SESSION['s_lang']."' ORDER BY question_order";
$sqresult = db_execute_assoc($subquestionquery); //Checked

foreach ($sqresult->row_array() as $subquestionrow)
foreach ($sqresult->read() as $subquestionrow)
{
$mandatorys[]=$ia[1].$subquestionrow['title'];
$mandatoryfns[]=$ia[1];
Expand Down Expand Up @@ -936,7 +936,7 @@ function mandatory_message($ia)
$qtitle .= ' '.$clang->gT('Please check at least one item.').'.';
$qquery = "SELECT other FROM {{questions}} WHERE qid=".$ia[0];
$qresult = db_execute_assoc($qquery); //Checked
$qrow = $qresult->row_array();
$qrow = $qresult->read();
if ($qrow['other']=='Y')
{
$aQuestionAttributes=getQuestionAttributeValues($ia[0],$ia[4]);
Expand Down Expand Up @@ -3545,7 +3545,7 @@ function excludeAllOthers$ia[1](value, doconditioncheck)

$qquery = "SELECT other FROM {{questions}} WHERE qid=".$ia[0]." AND language='".$_SESSION['s_lang']."' and parent_qid=0";
$qresult = db_execute_assoc($qquery); //Checked
$qrow = $qresult->row_array(); $other = $qrow['other'];
$qrow = $qresult->read(); $other = $qrow['other'];

if ($aQuestionAttributes['random_order']==1) {
$ansquery = "SELECT * FROM {{questions}} WHERE parent_qid=$ia[0] AND scale_id=0 AND language='".$_SESSION['s_lang']."' ORDER BY ".db_random();
Expand Down Expand Up @@ -5881,7 +5881,7 @@ function do_array_10point($ia)

$qquery = "SELECT other FROM {{questions}} WHERE qid=".$ia[0]." AND language='".$_SESSION['s_lang']."'";
$qresult = db_execute_assoc($qquery); //Checked
$qrow = $qresult->row_array(); $other = $qrow['other'];
$qrow = $qresult->read(); $other = $qrow['other'];

$aQuestionAttributes=getQuestionAttributeValues($ia[0],$ia[4]);
if (trim($aQuestionAttributes['answer_width'])!='')
Expand Down Expand Up @@ -6355,7 +6355,7 @@ function do_array($ia)

$qquery = "SELECT other FROM {{questions}} WHERE qid={$ia[0]} AND language='".$_SESSION['s_lang']."'";
$qresult = db_execute_assoc($qquery); //Checked
$qrow = $qresult->row_array(); $other = $qrow['other'];
$qrow = $qresult->read(); $other = $qrow['other'];
$lquery = "SELECT * FROM {{answers}} WHERE qid={$ia[0]} AND language='".$_SESSION['s_lang']."' and scale_id=0 ORDER BY sortorder, code";

$aQuestionAttributes=getQuestionAttributeValues($ia[0],$ia[4]);
Expand Down Expand Up @@ -6900,7 +6900,7 @@ function do_array_multitext($ia)
$cellwidth=sprintf('%02d', $cellwidth);

$ansquery = "SELECT count(question) FROM {{questions}} WHERE parent_qid={$ia[0]} and scale_id=0 AND question like '%|%'";
$ansresult = reset(db_execute_assoc($ansquery)->row_array());
$ansresult = reset(db_execute_assoc($ansquery)->read());
if ($ansresult>0)
{
$right_exists=true;
Expand Down Expand Up @@ -7092,7 +7092,7 @@ function do_array_multiflexi($ia)
$defaultvaluescript = '';
$qquery = "SELECT other FROM {{questions}} WHERE qid=".$ia[0]." AND language='".$_SESSION['s_lang']."' and parent_qid=0";
$qresult = db_execute_assoc($qquery);
$qrow = $qresult->row_array(); $other = $qrow['other'];
$qrow = $qresult->read(); $other = $qrow['other'];

$aQuestionAttributes=getQuestionAttributeValues($ia[0],$ia[4]);
if (trim($aQuestionAttributes['multiflexible_max'])!='' && trim($aQuestionAttributes['multiflexible_min']) ==''){
Expand Down Expand Up @@ -7445,7 +7445,7 @@ function do_arraycolumns($ia)
$aQuestionAttributes=getQuestionAttributeValues($ia[0],$ia[4]);
$qquery = "SELECT other FROM {{questions}} WHERE qid=".$ia[0]." AND language='".$_SESSION['s_lang']."'";
$qresult = db_execute_assoc($qquery); //Checked
$qrow = $qresult->row_array(); $other = $qrow['other'];
$qrow = $qresult->read(); $other = $qrow['other'];
$lquery = "SELECT * FROM {{answers}} WHERE qid=".$ia[0]." AND language='".$_SESSION['s_lang']."' and scale_id=0 ORDER BY sortorder, code";
$lresult = db_execute_assoc($lquery); //Checked
if ($lresult->count() > 0)
Expand Down Expand Up @@ -7608,7 +7608,7 @@ function do_array_dual($ia)
$labelans1=array();
$labelans=array();
$qquery = "SELECT other FROM {{questions}} WHERE qid=".$ia[0]." AND language='".$_SESSION['s_lang']."'";
$other = reset(db_execute_assoc($qquery)->row_array()); //Checked
$other = reset(db_execute_assoc($qquery)->read()); //Checked
$lquery = "SELECT * FROM {{answers}} WHERE scale_id=0 AND qid={$ia[0]} AND language='".$_SESSION['s_lang']."' ORDER BY sortorder, code";
$lquery1 = "SELECT * FROM {{answers}} WHERE scale_id=1 AND qid={$ia[0]} AND language='".$_SESSION['s_lang']."' ORDER BY sortorder, code";
$aQuestionAttributes=getQuestionAttributeValues($ia[0],$ia[4]);
Expand Down

0 comments on commit df07a4e

Please sign in to comment.