exec("CREATE DATABASE IF NOT EXISTS " . getenv('DB_NAME')); $conn->exec("USE " . getenv('DB_NAME')); // Create table for files $sql = "CREATE TABLE IF NOT EXISTS files ( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, filename VARCHAR(255) NOT NULL, filesize INT(11) NOT NULL, filetype VARCHAR(50) NOT NULL, upload_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP )"; $conn->exec($sql); echo "Database and table created successfully."; } catch(PDOException $e) { echo "Error: " . $e->getMessage(); } ?>