sars-scanner/html/laender.php

22 lines
738 B
PHP

<?php
include "../config.php";
if(isset($_GET['land'])){
$sql = "SELECT scans.id, place, amount, deaths, active, cured, time FROM `data` inner join scans on scans.id=data.scan WHERE place like ? group by amount order by time desc ";
$stmt = $pdo->prepare($sql);
$like = "%".trim($_GET['land'])."%";
$stmt->bindParam(1, $like);
$stmt->execute();
$data = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo '<table>';
echo '<tr><th>id</th><th>Scan-No</th><th>infected</th><th>dead</th><th>active</th><th>cured</th><th>time</th></tr>';
foreach ($data as $row){
echo '<tr>';
foreach ($row as $item) {
echo '<td>'.$item.'</td>';
}
echo '</tr>';
}
echo '</table>';
}