Hi,
I'm building a website that fetches text from another page and insert it into the database.
The problem is that all the special characters are saved in the database using the HTML encoding so then I need to convert the output using:
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
I mean, what I have right now is instead of just saving the character " ' " the html version " '
" is saved in the database. This happens also when spanish characters or another special ones are saved. Instead of the letter " ñ " for ejample, I get " ñ
" saved.
This wastes space in the database and also I need to later convert the output using content-type so:
How can I just convert or set the charset before is saved or just let MySQL convert it??
In case you need to know here's how I connect to the database:
function dbConnect() {
$conn = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME) or die ('Error.');
return $conn;
}
$conn = dbConnect();
$stmt = $conn->stmt_init();
Hope you can help me!! Thanks.