S
Sylvie Stone
Hi Group!
Can someone PLEASE tell me why this is not returning the $one variable
?
I'l pulling results from a survey database table where the answers was
a range from 1 - 10. This is howe I'm unsuccessfully printing the
results:
my @numbers = (["0"],["1"],
["2"],["3"],["4"],["5"],["6"],["7"],["8"],["9"],["10"]);
my $sth = $dbh->prepare('select count(*) from $SURVEYTABLE where info
= ?');
my $i = 0;
foreach (@numbers) {
my ($nums) = @$_;
$sth->execute( $nums );
++$i;
my $one = $sth->fetchrow_array();
print "one is $one<br>num is $nums<br>\n";
print "<font color=\"#0000FF\"><b>$one</b></font> respondants did not
answer this question" if ($nums eq "0");;
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
1<br>" if ($nums eq "1");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
2<br>" if ($nums eq "2");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
3<br>" if ($nums eq "3");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
4<br>" if ($nums eq "4");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
5<br>" if ($nums eq "5");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
6<br>" if ($nums eq "6");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
7<br>" if ($nums eq "7");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
8<br>" if ($nums eq "8");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
9<br>" if ($nums eq "9");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
10<br>" if ($nums eq "10");
}
TIA!
Sylvie.
Can someone PLEASE tell me why this is not returning the $one variable
?
I'l pulling results from a survey database table where the answers was
a range from 1 - 10. This is howe I'm unsuccessfully printing the
results:
my @numbers = (["0"],["1"],
["2"],["3"],["4"],["5"],["6"],["7"],["8"],["9"],["10"]);
my $sth = $dbh->prepare('select count(*) from $SURVEYTABLE where info
= ?');
my $i = 0;
foreach (@numbers) {
my ($nums) = @$_;
$sth->execute( $nums );
++$i;
my $one = $sth->fetchrow_array();
print "one is $one<br>num is $nums<br>\n";
print "<font color=\"#0000FF\"><b>$one</b></font> respondants did not
answer this question" if ($nums eq "0");;
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
1<br>" if ($nums eq "1");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
2<br>" if ($nums eq "2");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
3<br>" if ($nums eq "3");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
4<br>" if ($nums eq "4");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
5<br>" if ($nums eq "5");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
6<br>" if ($nums eq "6");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
7<br>" if ($nums eq "7");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
8<br>" if ($nums eq "8");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
9<br>" if ($nums eq "9");
print "<font color=\"#0000FF\"><b>$one</b></font> respondants rated
10<br>" if ($nums eq "10");
}
TIA!
Sylvie.