9
Hello, after noticing that my code is full of strange characters like ??? I tried to fix it but found I need to change the charset through the mysqli connection, but the problem is I don’t know how to do it!
Can someone help me?
Here’s my connection code mysqli
config.php
<?php
//site specific configuration declartion
define( 'BASE_PATH', 'http://localhost/user_login/');
define( 'DB_HOST', 'localhost' );
define( 'DB_USERNAME', 'root');
define( 'DB_PASSWORD', '');
define( 'DB_NAME', 'login');
function __autoload($class)
{
$parts = explode('_', $class);
$path = implode(DIRECTORY_SEPARATOR,$parts);
require_once $path . '.php';
}
?>
Dbclass
<?php
class Cl_DBclass
{
/**
* @var $con vai realizar conexão com o banco
*/
public $con;
/**
* Isto irá criar uma conexão de banco de dados
*/
public function __construct()
{
$this->con = mysqli_connect(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME);
if( mysqli_connect_error()) echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
}
?>
From now on Thank you!
What is the meeting of the bank and its page?
– rray