<?php
function broj_reci_recenici($recenica, $dokument)
{
$con= mysqli_connect("localhost","tagstudi_aldina","aldina1234567","tagstudi_dokumenta");
$result = mysqli_query($con,"SELECT  id_dokumenta, id_recenice, sum(br_poj) as broj_reci_u_recenici FROM recenica_reci 
where id_dokumenta=$dokument and id_recenice=$recenica");
while($row = mysqli_fetch_array($result))
  {
  $m= $row['broj_reci_u_recenici'];
  }
return $m;
}
//$a=broj_reci_recenici(4,1001);
 //echo $a;
?>