twister
Howdy
Hey can anyone help me with this? I'm pulling a bunch of info out of a database. Each value of row[1] will be one of six choices. Now i need to count up those choices. So i wrote this.
if ( $row[1] == "Strongly Disagree") {
$Q1SD++;
} elseif ( $row[1] == "Sorta Disagree") {
$Q1KD++;
} elseif ( $row[1] == "Disagree") {
$Q1D++;
} elseif ( $row[1] == "Agree") {
$Q1A++;
} elseif ( $row[1] == "Sorta Agree") {
$Q1KA++;
} elseif ( $row[1] == "Strongly Agree") {
$Q1SA++;
} else {
}
It will work fine for Strongly Disagree but nothing more. If i echo the $row[1] I will get Sorta Disagree for some of the answers but it will not count them. It will only count how may Disagree's because that's what it came across first.
Data:
$row = Disagree,Sorta Agree,Agree,Disagree,Agree
What's up?
Thanks
if ( $row[1] == "Strongly Disagree") {
$Q1SD++;
} elseif ( $row[1] == "Sorta Disagree") {
$Q1KD++;
} elseif ( $row[1] == "Disagree") {
$Q1D++;
} elseif ( $row[1] == "Agree") {
$Q1A++;
} elseif ( $row[1] == "Sorta Agree") {
$Q1KA++;
} elseif ( $row[1] == "Strongly Agree") {
$Q1SA++;
} else {
}
It will work fine for Strongly Disagree but nothing more. If i echo the $row[1] I will get Sorta Disagree for some of the answers but it will not count them. It will only count how may Disagree's because that's what it came across first.
Data:
$row = Disagree,Sorta Agree,Agree,Disagree,Agree
What's up?
Thanks