我正在从读取数据,并希望每秒更新一次数据。
<h1><?php
$conn = new mysqli('localhost','q88','88888888','db');
if ($conn->connect_error) {die("Connection failed: " . $conn->connect_error);
}$sql = "SELECT text FROM datatable where name= 'Air Cooler'";
$result = $conn->query($sql);if ($result->num_rows > 0) {while($row = $result->fetch_assoc()) {
echo $row["text"];}} else {echo "0 results";}
$conn->close();
?></h1>