I am trying to create a simple voting system, and it works good for the first few votes. But the more number of votes it gets the wierder it behaves. I can do a good vote and it will lower the score for some reason. This is what I have.
[codebox]$voteNum = $paget['num_votes'];
$totalScore = $paget['score'];
//check if they voted up or down
if($voteDir == "plus"){
$totalScore = $totalScore + 10;
}else{
$totalScore = $totalScore + 1;
}
//do our math to create a score for the tutorial
$newRating = bcdiv($totalScore, ++$voteNum, 1);[/codebox]
Voting
Started by
ChrisChase
, Feb 10 2010 03:53 PM
1 reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users