Author |
Topic |
|
spyordie007
Junior Member
USA
408 Posts |
Posted - 30 April 2003 : 14:04:54
|
This should be really simple to create, but I would like to have a count of the trips to the DB get inserted in the output within a comment (so that end users dont see it). I would also like to hide the Timer within a comment so that end users cannot see that either.
The Database Trip Count should be fairly simple to create (as Davio hinted here), the twist would just be to wrap both within a comment so that the way to view them would be to look at the source of the HTML output. -Spy |
Power - The only narcotic controlled by the SEC, not the FDA.
Prosperity without pollution! The American Hydrogen Association - http://www.ahanw.org Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum |
|
spyordie007
Junior Member
USA
408 Posts |
Posted - 07 May 2003 : 12:32:06
|
bump, someone please? This should be easy...
-spy |
Power - The only narcotic controlled by the SEC, not the FDA.
Prosperity without pollution! The American Hydrogen Association - http://www.ahanw.org Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum |
|
|
red1
Junior Member
355 Posts |
Posted - 07 May 2003 : 14:01:31
|
Yes the concept is simple, but you'd need to scour all the forum files for all instances of DB calls. If you really want to do it...
Insert this in config.asp (somewhere near the top) Dim intDBCalls intDBCalls = 0
Then look for all instances of rs.Open or set rs = My_conn.Execute. Note that the variable names may be different. Undeneath each one of those insert this: intDBcalls = intDBcalls + 1
Then in inc_footer.asp find the part where the timer is written and insert this: Response.Write "<!-- DB Calls = " & intDBCalls & " -->" |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 07 May 2003 : 16:28:57
|
^^^ that's not really an optimal way to do it, too much room for human error (missing recordsets). It would be nice to dynamically find all queries being executed for each individual page. |
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 07 May 2003 : 18:33:14
|
Yeah, what Rui said.
I basically did a search for .open and for my_conn.execute in the files and did what red1 posted. It catches all the record sets. |
Support Snitz Forums
|
|
|
snaayk
Senior Member
USA
1061 Posts |
Posted - 08 May 2003 : 10:50:50
|
quote: Originally posted by ruirib
Unless you encapsulate your DB calls in a function, how else can you do it?
Thats what I am doing now and it works like a dream. I have one function for those that may require paging and one that doesn't. The code is easier to read. And I can easily count queries on a page |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 08 May 2003 : 11:57:37
|
quote: Thats what I am doing now and it works like a dream.
Dreams don't always go the way we want it to. |
Support Snitz Forums
|
|
|
snaayk
Senior Member
USA
1061 Posts |
Posted - 08 May 2003 : 12:59:13
|
ah yes..it starts as a dream, then suddenly, it turns into a terrible nightmare!! |
|
|
|
Topic |
|