You can't just 'whip up' columns that don't exist. And generating potentially hundreds or even thousands of columns, to allow them to use whatever currency they like, is a bad idea. I would recommend you rethink your approach and instead of having columns use a single column to describe each one.
For example, have a table with currency_type, currency, newrate_type, newrate, sek_type, sek and then fill those fields in where appropriate. So if they entered...
Code: Select all
$currencyType = 'GBP';
$currency = 100;
$newRateType = 'VAT';
$newRate = '20%';
$sekType = 'Whatever';
$sek = 44;
You would use the following query:
Code: Select all
$query = "UPDATE `currency` SET currency_type = '$currentyType', currency = '$currency' WHERE `id`='1'";
And so forth. I hope that makes sense.