PDO::ERRMODE_EXCEPTION ]); $tables = ["users", "elections", "positions", "election_assignments", "parties", "candidates", "votes", "audit_logs"]; echo "\nComparison Table:\n"; echo str_pad("Table", 25) . " | " . str_pad("Local", 10) . " | " . str_pad("Supabase", 10) . "\n"; echo str_repeat("-", 50) . "\n"; foreach ($tables as $table) { $localCount = $localPdo->query("SELECT COUNT(*) FROM $table")->fetchColumn(); // For Supabase, check if table exists first try { $supabaseCount = $supabasePdo->query("SELECT COUNT(*) FROM $table")->fetchColumn(); } catch (Exception $e) { $supabaseCount = "N/A (Error)"; } echo str_pad($table, 25) . " | " . str_pad($localCount, 10) . " | " . str_pad($supabaseCount, 10) . "\n"; } } catch (Exception $e) { echo "Error: " . $e->getMessage() . "\n"; }