UnknownPlayer Posted October 15, 2011 Share Posted October 15, 2011 Hi, i have 2 currencies in my mysql and when user add new article, he choose currency and price. Now i need search engine for searching articles, and i have problem in part when user choose to show only articles between 100 and 200 euros, so i need help to convert all currencies to euro(all in mysql query) and show from 100 to 200 dollars, so if article price is 100 euros, then to show it too. Can someone help me ? 1 euro = 0.70 $ (example for values) Quote Link to comment https://forums.phpfreaks.com/topic/249188-php-mysql-help-with-currency-convert/ Share on other sites More sharing options...
codeprada Posted October 15, 2011 Share Posted October 15, 2011 You have 2 currencies in your MySQL? You should really only have one standard. For instance either USD or EURO. Then it only takes a simple multiplication operation to convert to another currency on the fly. You now have the job of find the rates relative to your standard. These rates should be stored in a separate table. Rates --USD -2.00 --XCD -500 .... You can then select the appropriate rate and then multiply the corresponding value to make the conversion. Quote Link to comment https://forums.phpfreaks.com/topic/249188-php-mysql-help-with-currency-convert/#findComment-1279650 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.