html head meta http-equiv Content-Type content text html charset UTF-8

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
</head>
</html>
<?php
function printresult ($result) {
while (($row = $result->fetch_assoc()) != false) {
echo "Коинов: " .$row["coins"];
echo "<br />";
}
echo "Всего админов: " .$result->num_rows ;
}
$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 ();
?>