PDA

View Full Version : Multiple Steps wont work


lmayer4
08-10-2006, 03:40 PM
Morning,

I'm sure this is something simple but I just cant get it to work. If there are less than 4 guests its supposed to go to the third query but nothing is displayed. If its 4 it works fine.

Any thoughts would be great!

Thanks

Laura



my $Step2 = $connect->query($CountGuests);
while (my @results = $Step2->fetchrow())
{
if ($results[0] < "4")
{
# EXECUTE THE THIRD QUERY
my $Step3 = $connect->query($ResInfo);

# FETCHROW ARRAY
while (my @val = $Step3->fetchrow())
{
print "</table>";
print "<HTML><HEAD>";
print "<script type=\"text/javascript\">function setfocus() {document.access.guest.focus();}</script>";
print "<TITLE>Guest Access</TITLE></HEAD>";
print "<body onLoad=\"setfocus()\">";
print "<form name=\"access\" action=\"step2.cgi\" method=\"GET\">";
print "<INPUT TYPE=\"hidden\" NAME=\"BLDG\" VALUE=\"$cookie_id\">";
print "<INPUT TYPE=\"hidden\" NAME=\"resident\" VALUE=\"$val[0]\">";
print "<INPUT TYPE=\"hidden\" NAME=\"card_number\" VALUE=\"$name\">";
print "<INPUT TYPE=\"hidden\" NAME=\"Res_Room\" VALUE=\"$val[1]\">";
print "Swipe the residents card:<p>";
print "Guest: <input type=\"text\" name=\"guest\" size=30>";
print "</form></BODY></HTML>";
}
}

print "This resident has 4 guests already registered today. Please contact a supervisor.";
exit;
}

FishMonger
08-10-2006, 05:21 PM
Try taking the quotes off.

change
if ($results[0] < "4")

to
if ($results[0] < 4)