deepsiteseek / database_connection.php
Taper5749's picture
Custom E-Commerce Showcase Prompt
3b11c5d verified
raw
history blame contribute delete
349 Bytes
```php
<?php
$host = 'localhost';
$dbname = 'ecommerce_showcase';
$username = 'root';
$password = '';
try {
$pdo = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
die("Database connection failed: " . $e->getMessage());
}
?>
```