Saving Currency Symbols in MySQL

Posted on 2010-01-05
Last Modified: 2012-05-08

I'm trying to save Currency symbols in PHP/MySQL but they aren't saving correctly in the DB.

The Euro is saved as: ï

And the British Pound as: â

I'm using varchar(1) with utf8_general_ci collation for the currency.  The $ sign saves fine.

Any ideas on how I can get it the euro and pound to save as '¬' and '£' ?

Question by:NeedExpertHelp
    LVL 20

    Accepted Solution

    LVL 107

    Assisted Solution

    by:Ray Paseur
    You might also consider using an entity for the character.  You would not need to depend on making aprt of your DB UTF-8, (or messing around with PHP's spotty UTF-8 support) and most browsers should render the entity correctly.
    LVL 6

    Assisted Solution

    by:Ludwig Diehl
    if it is a web project then you could always store the ascii code (DEC) thus for

    pounds => 163
    euros => 128

    and if using PHP you can retrieve it using  chr(DEC) where DEC is the ascii code

    for further information you can take a look at

    If you want to store them( symbols ) directly to the database then you consider using latin1 as default charset


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now