1

this my code:

$stmt->prepare("UPDATE ".$PapierTableName."  SET nrating=nrating+1,`rating`=(rating+?)/nrating  WHERE `id`=? AND `title`=?");
$stmt->bind_param('iis', $rat,$id,$tit);

My question is about the priority: in this operation

`rating`=(rating+?)/nrating

the nrating that will be used is the one already incremented or the one that is present in column?
Thanks

Razorphyn
  • 1,314
  • 13
  • 37

1 Answers1

1

That already incremented one; due to Operator Precedence

Parentheses may be used to force precedence, if necessary

egig
  • 4,370
  • 5
  • 29
  • 50