Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to store Euro Symbol in mysql database?

Tags:

symbols

mysql

How to store symbol for Euro currency in MySQL Database ?

like image 668
Rachel Avatar asked Nov 09 '09 20:11

Rachel


People also ask

How to insert Euro symbol in MySQL?

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!

How do I save currency symbols in SQL database?

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.

How do I put the euro sign?

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.

How do I store and sign in MySQL?

Storing it as & is an appropriate method. You can echo it or use it in statements as & . And when I echo out '&amp' would it appear as '&' or it should use some php function to translate it to the '&' symbol?


Video Answer


1 Answers

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
like image 61
Andomar Avatar answered Sep 22 '22 08:09

Andomar