942,788 Members | Top Members by Rank

Ad:
  • PHP Code Snippet
  • Views: 3970
  • PHP RSS
0

Groovy website database query counter ..thing

by on Oct 12th, 2004
You've seen those sites that say how many seconds it took to parse the page and how many database queries comprised the page. Well heres the database query bit...
PHP Code Snippet (Toggle Plain Text)
  1. function mysql_query_2($query){
  2. $_SESSION['queries']++;
  3. return mysql_query($query);
  4.  
  5. // now use mysql_query_2() function in place of mysql_query()
  6. // Each query will execute exactly the same but count up in
  7. // session variable 'queries'
  8.  
  9. echo "$_SESSION['queries']";
  10.  
  11. // just output it somewhere like above...
Comments on this Code Snippet
Aug 2nd, 2006
0

Re: Groovy website database query counter ..thing

About as small and clean as it gets. Nice one.
Newbie Poster
klinke is offline Offline
1 posts
since Aug 2006
Message:
Previous Thread in PHP Forum Timeline: Parse Error T_STRING - Help Please
Next Thread in PHP Forum Timeline: trouble with long output string, plz help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC