22 lines
509 B
PHP
22 lines
509 B
PHP
<?php
|
|
require_once 'config.php';
|
|
|
|
try {
|
|
$pdo = db();
|
|
|
|
// donors table
|
|
$sql_donors = "
|
|
CREATE TABLE IF NOT EXISTS donors (
|
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
name VARCHAR(255) NOT NULL,
|
|
email VARCHAR(255) NOT NULL UNIQUE,
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);";
|
|
$pdo->exec($sql_donors);
|
|
echo "Database table 'donors' created successfully (if it didn't exist).\n";
|
|
|
|
} catch (PDOException $e) {
|
|
die("DB ERROR: " . $e->getMessage());
|
|
}
|
|
|