Skip to content

Commit

Permalink
Added routine for handling surveys with no questions
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@153 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Mar 26, 2003
1 parent 27e4531 commit 99949cf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions index.php
Expand Up @@ -465,6 +465,15 @@
$aresult = mysql_query($aquery);
$totalsteps = mysql_num_rows($aresult);

if ($totalsteps == "0")
{
//break out and crash if there are no questions!
echo "$setfont<center><b>$sitename</b><br />\n<br />\n<b>This survey does not yet have any questions, and so cannot be accessed.</b><br />\n";
echo "<br />\nPlease contact $siteadminemail for information.<br /><br />\n";
echo "<a href=\"javascript:window.close()\">Close Window</a>\n";
exit;
}

$arows = array(); //Create an empty array in case mysql_fetch_array does not return any rows
while ($arow = mysql_fetch_assoc($aresult)) {$arows[] = $arow;} // Get table output into array

Expand Down

0 comments on commit 99949cf

Please sign in to comment.