I have a simple database that I am using to store the temperature of my pool and outside temperature every 10 to 30 minutes. The issue I am having is with the code that I have I can run the query locally in MySQL and it works just fine. But when I have the same query in PHP it gives me a blank page.
<?php
$dbhost = "localhost";
$dbuser = "xxxx";
$dbpass = "xxxxxxxxxx";
$dbname = "pool_db";
// Create connection
$conn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname) or die("Error " .mysqli_error($conn));
$sql = "SELECT * FROM tempLog ORDER BY dateTime DESC";
$results = mysqli_query($conn, $sql) or die("Error " .mysqli_error());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
while($row = mysqli_fetch_array($results)); {
?>
<p><?php echo $row['poolTemp'];?></p>
<?php
}
?>
</body>
</html>