connect_error)
{
quit();
}
$stmt = $con->prepare("SELECT status.name AS status, COUNT(*) AS sCount, status.color AS color FROM secondLevel JOIN status ON secondLevel.status_id = status.id WHERE secondLevel.parent_id = (SELECT id FROM topLevel WHERE name = ?) GROUP BY status.id");
$stmt->bind_param("s", $tile);
$stmt->execute();
$result = $stmt->get_result();
$ret = $result->fetch_all(MYSQLI_ASSOC);
echo 'Tile Name | ' . $tile . ' |
';
foreach ($ret as $row)
{
echo '' . $row["status"] . ' | ' . $row["sCount"] . ' |
';
}
echo '
';
}
?>