$qr_result = $sql; // что это??? где вы запрос в базу делаете?
попробуйте так
<?php
$db_host = 'localhost';
$db_name = 'rgraph_example';
$db_username = 'user';
$db_password = 'password';
$connect_to_db = mysql_connect($db_host, $db_username, $db_password);
if (!$connect_to_db) {
die("Could not connect: " . mysql_error());
}
if (!mysql_select_db($db_name, $connect_to_db)) {
die("Could not select DB: " . mysql_error());
}
$sql = "SELECT `daily_statistics`.`Values` , `daily_statistics`.`Id` , `Humidity`.`Humidity` , `Temp`.`Value` ".
"FROM daily_statistics LEFT JOIN `rgraph_example`.`Humidity` ON `daily_statistics`.`Id` = `Humidity`.`Id` ".
"LEFT JOIN `rgraph_example`.`Temp` ON `daily_statistics`.`Id` = `Temp`.`Id` LIMIT 0 , 30";
$result = mysql_query($sql);
if (!$result) {
die(mysql_error());
}
$data = array();
while ($row = mysql_fetch_array($qr_result)) {
$data[] = $row;
}
?>
<table border="1">
<thead>
<tr>
<th>id</th>
<th>Values</th>
<th>Humidity</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach ($data as $item):?>
<tr>
<td><?php echo $item['Id'] ?></td>
<td><?php echo $item['Values'] ?></td>
<td><?php echo $item['Humidity'] ?></td>
<td><?php echo $item['Value'] ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>