<?php
require_once __DIR__ . '/config/database.php';
$db = getDb();

echo "Table: user_addresses\n";
$res = $db->query("DESCRIBE user_addresses");
while($row = $res->fetch_assoc()) {
    echo $row['Field'] . " (" . $row['Type'] . ")\n";
}

echo "\nChecking user t5@gamil.com\n";
$res = $db->query("SELECT id FROM users WHERE email = 't5@gamil.com'");
$user = $res->fetch_assoc();
if ($user) {
    $uid = $user['id'];
    echo "UID: $uid\n";
    $res = $db->query("SELECT * FROM user_addresses WHERE user_id = $uid");
    while($row = $res->fetch_assoc()) {
        print_r($row);
    }
}
?>
