Thread: Displaying currency symbol
05-30-14, 02:52 #1Registered User
- Join Date
- Feb 2014
Unanswered: Displaying currency symbol
I am using PHP/MySQL to record matters and the currency they are going to be charged in. The table is called 'matters' and some of the fields are:
Chargerate is a decimal (10,2) and records a monetary value, currency is entered as a word - Sterling, Euros or Dollars.
I also have a table 'currency' which has 3 fields - currencyid, currency and symbol.
What I am trying to get out is a line on the page which shows the symbol followed by the rate. I have added a line in my query:
CONCAT(symbol,chargerate) AS showrate
but this just shows a series of black diamonds with a ? in the middle instead of the symbol.
How can I get the view I want?
05-30-14, 03:38 #2Jaded Developer
Provided Answers: 59
- Join Date
- Nov 2004
- out on a limb
So im guessing you are using the ISO currency code as the pk in the currency table
use the pk in the currency table as the FK in the transaction table. one of the main reasons for usign the ISO code is that because its an internationally defined range of values its instantly recognisable by virtually anybody who has dealt with foreign / multi currency applications. standards exist for a reason...
by all mean s dispaly a list or combo box that has the currency name in if you feel thats important, but store the data as the ISO code.
when you come to etract the symbol do it using a join
select my, column, list from mytable
join currency on mytable.currcode = currency.isocodeI'd rather be riding on the Tiger 800 or the Norton