How to store symbol for Euro currency in MySQL Database ?
Create a column with a character set that supports the Euro character. CREATE TABLE MyTable ( MyEuroColumn VARCHAR(5) CHARACTER SET utf8 COLLATE utf8_general_ci ); If your editor doesn't support Unicde, you can insert it like; select concat('Five ', _ucs2 0x20AC, ' please!
Even if the symbol is stored in another column and you pull it out as needed. Rather a better approach would be to store the region / locale for the currency data then, format the currency using the regions default formatting.
The European Union's Interinstitutional Style Guide (for EU staff) states that the euro sign should be placed in front of the amount without any space in English, but after the amount in most other languages.
Storing it as & is an appropriate method. You can echo it or use it in statements as & . And when I echo out '&' would it appear as '&' or it should use some php function to translate it to the '&' symbol?
Create a column with a character set that supports the Euro character.
CREATE TABLE MyTable
(
MyEuroColumn VARCHAR(5)
CHARACTER SET utf8
COLLATE utf8_general_ci
);
If your editor doesn't support Unicde, you can insert it like;
select concat('Five ', _ucs2 0x20AC, ' please!')
You can also store the Euro symbol in other character sets:
UTF-8 0xE282AC
UCS-16 0x20AC
ISO-8859-15 (latin-9) 0xA4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With