DOCTYPE html html lang ru head meta charset UTF-8 meta name viewport c

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Test</title>
</head>
<body>
<?php
$mysqli = new mysqli ("localhost", "root", "", "coins");
$mysqli-> query ("SET NAMES 'utf8'");
//$acoin = $mysqli-> query ("INSERT INTO `coins` (`coins`) VALUES ('225')") ;
//$mysqli-> query ("UPDATE `coins` SET `coins` = '234890' WHERE `id` =2;");
$result = $mysqli-> query ("SELECT * FROM `coins` ");
printresult ($result);
$mysqli->close ();
function printresult ($result) {
while (($row = $result->fetch_assoc()) != false) {
echo "Коинов: " .$row["coins"];
echo "<br />";
}
echo "Всего админов: " .$result->num_rows ;
}
?>
</body>
</html>