// db_connection.php $servername = "localhost"; $username = "bric_main"; $password = "JNjuPkVyjCZnltip"; $dbname = "bric_main"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname;charset=utf8", $username, $password); // Set PDO to throw exceptions for errors $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { error_log("Database connection failed: " . $e->getMessage()); die("Database connection error."); }