Hello,

I have created a predictionscompetition and some code counts te total score of a match 
of a person.
On the screen it workes, but in de database it goes wrong. Each person gets the total 
of the last person. There must be something wrong with the update statement.
I hope someone can help me.

Cheers,
Martin.

$number = MYSQL_NUMROWS($result);
$i = 0;
 WHILE ($i < $number):
  $naam = mysql_result($result,$i,"naam");
  $uit_gr = mysql_result($result,$i,"uit_gr");
  $uit_te = mysql_result($result,$i,"uit_te");
  $ru_gr = mysql_result($result,$i,"ru_gr");
  $ru_te = mysql_result($result,$i,"ru_te");
  $minuut = mysql_result($result,$i,"minuut");
  $toto = mysql_result($result,$i,"toto");

   /* Count everything*/

  $t01 = $u1+$r1+$b1+$m1+$t1;
  $sqlb = "UPDATE voorspelling1 SET totaal='$t01' WHERE id_voorspelling = 
'$id_voorspelling'";
  $resultb = mysql_query($sqlb);
  PRINT "$naam     $uit_gr     $uit_te $u1 $r1 $b1 $m1 $t1 $t01<BR>";
  PRINT "$t1<BR>";
  $i++;
 ENDWHILE;

Reply via email to