<?php
// Hide all errors from being displayed to the user
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
error_reporting(0);

// Optional: set a custom error handler to log errors
set_error_handler(function($errno, $errstr, $errfile, $errline) {
    error_log("PHP Error [$errno]: $errstr in $errfile on line $errline");
    return true; // prevent default handler
});

// Database connection using mysqli
$servername = "localhost";
$username = "cybershi_cybershield";
$password = "Cyber@CODER@2024";
$dbname = "cybershi_cybershield";

// Suppress connection warnings using @ and check for errors
$conn = @new mysqli($servername, $username, $password, $dbname);

if ($conn->connect_error) {
    error_log("Database Connection Failed: " . $conn->connect_error);
    die("Sorry, we're experiencing technical difficulties."); // Generic message
    echo"Sorry, we're experiencing technical difficulties.";
}
 
 
?>
 
 

 <?php
// error_reporting(1);
// ini_set('display_errors', '1');
 
// $host="localhost";
// $uname="root";
// 	$pas="";
// 	$db_name="cybershield"; 

// 	$conn = mysqli_connect("$host","$uname","$pas") or die ("cannot connect");
// 	mysqli_select_db($conn,"$db_name") or die ("cannot select db");
?>