|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Does anyone know how to create a Top 10 Visited links lis yet? So far I have used the code:
SQL="SELECT TOP 10 Count(*) AS OD,TY,REF FROM log GROUP BY TY,REF ORDER BY OD DESC" But I think this code is wrong, TY is a description of the link, REF is the URL of the link Somebody please help? |
|
#2
|
|||
|
|||
|
Here, try this:
Set recordset = connection.Execute("SELECT COUNT(OD, TY, REF) FROM log ORDER BY OD DESC") x = 0 Do Until x = 10 Response.Write ("<a href=""" & recordset("REF") & """>" & recordset("TY") & "</a>") x = x + 1 recordset.MoveNext Loop Hope that helps, lemme know if you need help with anything else! ![]() |
|
#3
|
||||
|
||||
|
Big C - what was wrong with your code? It looks fine to me?
DeviantScripter - as a general rule, it's more efficient to only get the records you'll need from the database, rather than all of them. Esp once you start using tables w/ millions of records. |
|
#4
|
|||
|
|||
|
Of course it is. I knew that.
![]() But I wasn't sure what criteria he wanted to use in his SQL string to fetch records, so I just wrote the code to get them all. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Top 10 Visited Links? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|