1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- $host = "kurek620.beget.tech";
- $username = "kurek620_baze";
- $password = "6910WASD579h";
- $database = "kurek620_baze";
- $mysql = new mysqli($host, $username, $password, $database);
- if($mysql->connect_error){
- die("Ошибка подключения". $mysql->connect_error);
- }
- $query = "SELECT COUNT(*) as count FROM `Users`";
- $result = $mysql->query($query);
- $row = $result->fetch_assoc();
- $count = $row['count'];
- if(!$result){
- echo "что-то не так";
- }
-
-
- $query1 = "SELECT COUNT(*) as count1 FROM `reviews`";
- $result1 = $mysql->query($query1);
- $row1 = $result1->fetch_assoc();
- $count1 = $row1['count1'];
- if(!$result1){
- echo "что-то не так";
- }
- $query2 = "SELECT AVG(rating) as Avg_b FROM `reviews`";
- $result2 = $mysql->query($query2);
- $row2 = $result2->fetch_assoc();
- $Avg_b = $row2['Avg_b'];
- if(!$result2){
- echo "что-то не так";
- }
- ?>
|