<?php
require __DIR__ . '/../vendor/autoload.php';
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/..');
$dotenv->safeLoad();

$pdo = App\Database::getConnection();
$tables = ['doctors','institutions','patients','patient_relatives','patient_referrals'];
foreach ($tables as $t) {
  try {
    $c = $pdo->query("SELECT COUNT(*) FROM `{$t}`")->fetchColumn();
    echo $t . ": " . (int)$c . "\n";
  } catch (Throwable $e) {
    echo $t . ": ERROR - " . $e->getMessage() . "\n";
  }
}
