Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query about how many times a query was made

Status
Not open for further replies.

kentusha

Programmer
May 18, 2005
8
0
0
DE
sorry I am very new to sql, so forgive me if this sounds daf, I have a javascript tree that accesses an sql database, you can have a look at anyway I need to know how many times a row is queried.

for example I would like to know how many times url was queried or accessed:

INSERT INTO treemenu_test ( id, prev, title, url, target, attributes, folder_flag) VALUES("7","6","A Girl Apart","
how could I do such a thing?

thanks
 
You would need to log the page views into the database (which I'm assuming the insert statement is doing?). You'll then need to query the table with a select statement a do a count(*) to find the number of records.

For example:
Code:
select url, count(*)
from treemenu_test
group by url
order by url

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
thanks for the interest, I should have made myself clearer, Iconfused the issue by showing the insert statement.

The insert statement is actually how I build the row, I just meant to show the logic of the columns.

No insert is happening behind the scenes where I can count up.

any other tips?
 
In order to count something in the database the action must be logged into a table somewhere.

It the action isn't logged into a table, then you can't count it.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top