Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $connect=mysqli_connect('localhost','root','','baza');
- $question="SELECT cena FROM dania WHERE typ=1;";
- $howmuch=mysqli_num_rows($query);
- $counter=0;
- $query=mysqli_query($connect,$question);
- while($row=mysqli_fetch_array($query)){
- $counter=$counter+$row[0];
- }
- $counter2=$counter/$howmuch;
- echo round($counter2,2)."zł";
- ?></p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement