<?php

// load service db setting
$hasServiceDBSetting = file_exists("./../setup/service_db_setting.php");
if($hasServiceDBSetting == true) {
	include("./../setup/service_db_setting.php");
} else {
	$db_host = "localhost";
	$db_user = "chocomae";
	$db_passwd = "sEobMPuJ2A8KTfwU";
	$db_name = "chocomae";
}


// connect db
$db_conn = new mysqli($db_host, $db_user, $db_passwd, $db_name);
if ($db_conn->connect_error) {
    set_error_message("Failed to connect DB: ".$db_conn->connect_error);
    send_result_fail();
    exit;
} else {
	$query = "USE chocomae";
	$result = mysqli_query($db_conn, $query);
}

?>