<?php
$hostname = "localhost";
$database = "dragon";
$username = "root";
$password = "";

$conn_sqli 		= mysqli_connect($hostname, $username, $password, $database);
$mysqli 		= new mysqli($hostname, $username, $password, $database);
$conn    		= new mysqli($hostname, $username, $password, $database);
if ($mysqli->connect_errno) {
    die("Error de conexión: ({$mysqli->connect_errno}) {$mysqli->connect_error}");
}
if (!$mysqli->set_charset("utf8")) {
    die("Error al setear charset: " . $mysqli->error);
}
if (!$resultado = $mysqli->query("SELECT 1")) {
    die("La conexión respondió, pero el query de prueba falló: " . $mysqli->error);
}

mysqli_set_charset($conn_sqli,"utf8");
mysqli_set_charset($mysqli,"utf8");
mysqli_set_charset($conn,"utf8");

$resultado->free();

?>