Sample data products from the database with different currencies?

The essence of the problem is this:

1. There is a search form which has a field, for example, the value of the goods from...to.
2. The user enters for example from 100 USD to 500 USD
3. The database has the records of goods that have price fields, and there are currency_id currency table

If, for example, the search item for $ 300, it will appear in the selection of goods for $ 300 and, for example, for 200 euros, but for 300 euros not come as 300 Euro more than 300 dollars.

Ie at the level of the query, all is given to any single currency?
September 19th 19 at 12:49
1 answer
September 19th 19 at 12:51
Crappy made base. The inconsistency of the base causes the base itself ceases to understand how to map entities to each other, in your case, you can't query against a table of goods to know which one is more expensive and some cheaper. Keep Liebe two fields - in the rubles and the currency, or communicate with the base only in rubles and the conversion of produce for each request.
"big table is a nonsense" - you computer mind? For example, I feel sorry for myself when to make the usual "<"and\I have to choose a price, currency, currency joint at the second table, multiply, and only then to compare. The course changed every day and requests you may have thousands per second. It is logical to calculate the new prices, 1 per day, not thousands of times a second to consider the same. - maegan_OConnell66 commented on September 19th 19 at 13:00
Like the first three words. Then not even read it, and so it is clear what to write ) - Halle_Botsfo commented on September 19th 19 at 12:54
Base inherited.
Here is an example from life: the price of the hotel. Often hotels keep the prices of their rooms in the currency of the country in which they reside. One stores in dollars, the second in Vietnamese Dong.

The client needs to find a hotel not higher than the price stated in euros.

Again, keep in rubles crappy solution price in the specified currency may be changed, and to recalculate rates for the crown at the big table - nonsense. - connie.Klein40 commented on September 19th 19 at 12:57

Find more questions by tags PHPMySQL