0

so i have a table that have multiple rows and cell. Its a summary table that i have to populate from mysql database. This is my table:Summary Tabe

So my solution was to write an sql query for every single cell. But thats like 40 queries its not really efficient. Whats the best solution? Thanks.

2 Answers 2

1

Do you have problem with sql? As in you don't know how to write the query? Or is it something else that is bothering you?

If you can't explain the problem better then I don't think we can help you. Sql does have the option to sum various things in the query already. If you don't know how else to do it, you could even just do

           SELECT * FROM table 

and then filter through results with PHP, but that would be very slow, if you have to do it for a larger datasets then you would probably get timeout exception from your server. Or maximum memory exceded.

All in all, you need to describe the problem better.

And you would not write a new query for every cell, at least EUR -> HUF can be simply done by calculationg value of cell * currency_exchange_value.

Sign up to request clarification or add additional context in comments.

Comments

1

Just one query is enough to get all records from database and populate the result to table using for loop

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.