Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How to Count the queries done by a page
Old 04-29-2008, 12:12 PM How to Count the queries done by a page
andyp's Avatar
Extreme Talker

Posts: 165
Name: andy patterson
Trades: 0
I've noticed at the bottom of sites stuff like " site loaded with 15 queries" and I want to know how to get the number of queries done by a page.
__________________
My webmaster news & tips blogs with free scripts and tutorials -
Please login or register to view this content. Registration is FREE
andyp is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-29-2008, 12:18 PM Re: How to Count the queries done by a page
Extreme Talker

Posts: 177
Trades: 0
You could probably just set a session variable, and every time a query is executed, increment the session variable. (while loops do multiple queries)

I've never really done this before, so I might be mistaken.

also, while we're in here, maybe somebody can tell me how to check how efficient the queries are running or whatnot. The time it takes to query, etc. All the stuff you would want to know.
kbfirebreather is offline
Reply With Quote
View Public Profile
 
Old 04-29-2008, 01:39 PM Re: How to Count the queries done by a page
andyp's Avatar
Extreme Talker

Posts: 165
Name: andy patterson
Trades: 0
Well as far as I know you should only get the fields you need and just reduce your queries to the bare minium.
Check out:
http://www.devshed.com/c/a/MySQL/Enhancing-MySQL-Query-Efficiency/3/

http://www.informit.com/articles/article.aspx?p=377652
__________________
My webmaster news & tips blogs with free scripts and tutorials -
Please login or register to view this content. Registration is FREE
andyp is offline
Reply With Quote
View Public Profile
 
Old 05-31-2008, 02:06 AM Re: How to Count the queries done by a page
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
I know this is an older thread, but I've read a few requests for something like this, so I wrote an article and put it up on my site. I hope this helps you: http://www.teratask.com/index.php?pa...-count-queries
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Reply     « Reply to How to Count the queries done by a page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24968 seconds with 12 queries