954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Best way to query

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 code starts, or would it be just fine throughout the page in the 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!!

Scooby08
Newbie Poster
20 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

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.

Demiloy
Light Poster
48 posts since Aug 2008
Reputation Points: 12
Solved Threads: 6
 
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You