Reputation: 1951
When I inserted a €
into the database, it went in okay and is displayed in phpmyadmin properly. However, when I dump it through CodeIgniter it comes out as €
.
What am I doing wrong?
Upvotes: 0
Views: 60
Reputation: 8996
use
htmlentities('€');
to save into the database if you need data to be displayed into html pages
Upvotes: -1
Reputation: 8485
Make sure you set the character encoding to utf-8 everywhere. You need to set it in the HTML of the page with the form, any PHP-files where strings are inserted into SQL, the database/tables and on the page displaying the final output.
Get just one of these wrong and you will have problems.
Upvotes: 4
Reputation: 22466
Your character encoding is not good, UTF-8 will be better. You can read more about unicode in this great article on dev.mysql.com.
Upvotes: 1