Jump to content


Photo

Voting


  • Please log in to reply
1 reply to this topic

#1 ChrisChase

ChrisChase

    Young Padawan

  • Members
  • Pip
  • 7 posts

Posted 10 February 2010 - 03:53 PM

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]

#2 JoshuaGaler

JoshuaGaler

    Young Padawan

  • Members
  • Pip
  • 3 posts

Posted 12 February 2010 - 02:17 AM

HI!!
Can you just put the error that you get when you insert more data.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users