I can run this SQL statement in MySQL workbench and it works great but when I run it in scriptcase all I get is a blank page with the tile.
$sSQL = “set @last = ( select max(date) from all_data);
SELECT
type_entry,
COUNT(CASE WHEN DATEDIFF(@last, date) < 31 THEN value END) as val_count1,
FLOOR(SUM(CASE WHEN DATEDIFF(@last, date) < 31 THEN value END)) as sum_glu1,
COUNT(CASE WHEN DATEDIFF(@last, date) < 14 THEN value END) as val_count2,
FLOOR(SUM(CASE WHEN DATEDIFF(@last, date) < 14 THEN value END)) as sum_glu2,
COUNT(CASE WHEN DATEDIFF(@last, date) < 7 THEN value END) as val_count3,
FLOOR(SUM(CASE WHEN DATEDIFF(@last, date) < 7 THEN value END)) as sum_glu3
FROM all_data
WHERE DATEDIFF(@last, date) < 31 AND type_entry = ‘Glucose’
GROUP BY type_entry”;
sc_lookup(dataset,$sSQL);
?>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >
</head>
<body>
<div "container" style = "text-align: center">
<h2>Snapshot</h2>
</div>
<?php
foreach({dataset} as $avalue){
?>
<div class="container">
<table class = "table" style="text-align: center""width: 10%">
<tr>
<td><?php echo 'Number of Test for 7 Days: </td><td>'. $avalue[5]; ?></td>
</tr>
<tr>
<td><?php echo 'Average for 7 Days: </td><td>'. ROUND($avalue[6]/$avalue[5]); ?></td>
</tr>
<tr>
<td><?php echo 'Number of Test for 15 Days: </td><td>'. $avalue[3]; ?></td>
</tr>
<tr>
<td><?php echo 'Average for 14 Days: </td><td>'. ROUND($avalue[4]/$avalue[3]); ?></td>
</tr>
<tr>
<td><?php echo 'Number of Test for 30 Days: </td><td>'. $avalue[1]; ?></td>
</tr>
<tr>
<td><?php echo 'Average for 30 Days: </td><td>'. ROUND($avalue[2]/$avalue[1]); ?></td>
</tr>
</table>
</div>
<?php
}
?>
</body>
</html>
<?php
Anyone know what is happing?