<?php
error_reporting(); // (Consider: error_reporting(E_ALL); ini_set('display_errors', '0');)
$conn = mysqli_connect('localhost','qhtesting_user001','Y.SoidQ$4Bq2{Vy9','qhtesting_internation_scholars_test') 
    or die(mysqli_connect_error()); // <-- use mysqli_connect_error()

// ensure projects expecting $mysqli also work
$mysqli = $conn; // <-- add this line

try {
    $db = new PDO('mysql:host=localhost;dbname=qhtesting_internation_scholars_test', 'qhtesting_user001', 'Y.SoidQ$4Bq2{Vy9');
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    http_response_code(500);
    header('Content-Type: application/json');
    echo json_encode(['error' => 'database_connection_failed']);
    exit;
}
