Would anybody happen to know which of these ways is the better way to run your queries??

Would it be better to have all your SELECT queries before the actual <html> code starts, or would it be just fine throughout the page in the <body> tags?? Is one slower than another or maybe smoother than another?? Also, is having multiple queries slower than combining them into one query, or doesn't that really make a difference??

I have about 15 tables on one page that each runs its own query right now.. I have placed the query code within each table to extract the data needed for that specific table.. Im only asking because it just seems as if the page is loading and running a bit slower than without the queries.. Is this just normal for multiple queries to do this??

Thanks to all who reply!!

Recommended Answers

All 2 Replies

I don't think your placement inside the HTML will make a different.

Also, if you have to SELECT from different tables, then you can't really combine them. Well, you can with UNION, but I think separate queries from different tables would be better.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.