2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

checked for existence of result set before applying RecordCount method

New questionnaire form has larger text boxes for entering data - and hides entry when rs not required
This commit is contained in:
azammitdcarf
2008-11-14 00:58:44 +00:00
parent 26bc2b866c
commit 0976fe62ee
7 changed files with 37 additions and 16 deletions

View File

@@ -496,7 +496,7 @@ function display_calendar($respondent_id, $questionnaire_id, $year = false, $mon
AND MONTH(CONVERT_TZ(s.start,'UTC',r.Time_zone_name)) = '{$Day->thisMonth()}'
AND YEAR(CONVERT_TZ(s.start,'UTC',r.Time_zone_name)) = '{$Day->thisYear()}'");
if ($rs->RecordCount() == 0)
if (!empty($rs) && $rs->RecordCount() == 0)
{
echo ( "<td class=\"notavailable $today\">".$Day->thisDay()."</td>\n" );
}

View File

@@ -95,7 +95,7 @@ function create_limesurvey_questionnaire($title)
$isquery = "SELECT sid FROM ".db_table_name('surveys')." WHERE sid=$surveyid";
$isresult = $ldb->Execute($isquery);
}
while ($isresult->RecordCount()>0);
while (!empty($isresult) && $isresult->RecordCount() > 0);
$isquery = "INSERT INTO ". LIME_PREFIX ."surveys\n"
. "(sid, owner_id, admin, active, useexpiry, expires, "