ccwebstuff
09-27-2004, 06:48 PM
I know this may sound dumb - in other languages this would have been SO easy ... but here goes.
I'm trying to step through entire database to determine how many of each item ...
while ( $row = mysql_fetch_array($result) ) {
// process the row...
$cStatus = trim( $ROW["status"])
$winshow = $winshow + if( $cStatus == "WIN", 1, 0)
$loseshow = $loseshow + if( $cStatus == "Lose", 1, 0)
$pushshow = $pushshow + if( $cStatus == "PUSH", 1, 0)
}
Needless to say this code DOES not work
tried using a IF statement using
$winshow++
and each of the 3 numbers got the exact same quantity which I know is not correct.
syntax I was familiar with was
do case
case cStatus = "WIN"
winshow++
case cStatus = "Lose"
loseshow++
case cStatus = "Push"
pushshow++
end
Any help in this stupid and probably obvious error would be greatly appreciated!
I'm trying to step through entire database to determine how many of each item ...
while ( $row = mysql_fetch_array($result) ) {
// process the row...
$cStatus = trim( $ROW["status"])
$winshow = $winshow + if( $cStatus == "WIN", 1, 0)
$loseshow = $loseshow + if( $cStatus == "Lose", 1, 0)
$pushshow = $pushshow + if( $cStatus == "PUSH", 1, 0)
}
Needless to say this code DOES not work
tried using a IF statement using
$winshow++
and each of the 3 numbers got the exact same quantity which I know is not correct.
syntax I was familiar with was
do case
case cStatus = "WIN"
winshow++
case cStatus = "Lose"
loseshow++
case cStatus = "Push"
pushshow++
end
Any help in this stupid and probably obvious error would be greatly appreciated!