1

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.

1
  • 2
    :D yes it definitively is okay :P Commented Feb 10, 2012 at 15:28

2 Answers 2

3

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.

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

1 Comment

Thanks Christop for the tips.
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.