I have a php file which I use to build a table. I am basically echoing out the html code... For the data, I am using multiple select queries. The queries take the data in different tables... My question: Is it ok to run multiple select queries in one file? For security purpose or else? Thank you in advance for your replies. Cheers. Marc.
2 Answers
There is no problem to run several queries from the same PHP script. Some advice: Work through the results once the query is sent and store information in a local data structure if needed. That way resources can be freed quickly. Even better would be to join the queries if possible because each database call costs a lot of time.
1 Comment
Security concerns should be same for multiple queries and a single query. On the other hand, when it comes to mysql queries you should concern about performance. You may combine that seperate queries in one query and that way you can gain performance for avoiding sending multiple requests seperatly.