query("SELECT id, name, email, phone, company, status, created_at FROM contacts ORDER BY created_at DESC"); $contacts = $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { // In a real app, you'd log this error and show a user-friendly message. // For now, we'll just show a simple error. echo '
Error connecting to the database or fetching data. Please run the migration script.
'; } ?>

Contacts

Add Contact
Name Email Phone Company Status Actions
No contacts found. Add one to get started!