Chris Mccabe
Chris Mccabe

Reputation: 1951

Euro currency symbol is saved to database properly, but is displayed as € in CodeIgniter application

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

Answers (3)

Dalen
Dalen

Reputation: 8996

use

htmlentities('€');

to save into the database if you need data to be displayed into html pages

Upvotes: -1

geon
geon

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

Harmen
Harmen

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

Related Questions