Print Page | Close Window

show # of records next to categories

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=18437
Printed Date: 29 March 2026 at 4:24pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: show # of records next to categories
Posted By: urko
Subject: show # of records next to categories
Date Posted: 19 February 2006 at 12:01pm
I'm searching the web and can't find any article explaining how to show # of records for each category. Maybe I'm not looking  rightWink.

Example:
1. Category1 (5)
2. Category2 (4)
3. Category3 (0)

I'm using access db.


So if you guys know a site where can I find it, I would be cery happy LOL.

Thanks,


-------------
Urko



Replies:
Posted By: Scotty32
Date Posted: 19 February 2006 at 1:34pm
strSQL = "select id from records where records.cat_id = " & intCatID & ";"
rscommon.open strSQL, conn,3,3
if not rscommon.eof then
 intRecordCount = rscommon.recordcount
end if
rscommon.close

umm something like that


i think it might be best for performance if you had a field in the Category table keeping a count of the records, eg, when a records added, add 1 to the field


-------------
S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .


Posted By: urko
Date Posted: 19 February 2006 at 4:08pm
Thanks for the script.

I have encounter a problem with some code and I hope if some1 will help me out.

I have made an ad script. Noe the thing is that u have to be a member of my forum to be able to add an ad.
This part is working.

The problem that I have is:
On the detail page....a visitor ( member ) can see the ad + a name of a member which has placed it.
As I was looking at pop_up_profile.asp page, I was hoping to add a link so that members can send each other an email if they are interested in
certain add.

This is th e part of code which I added to my detail page


<!--#include file="../forum/common.asp" -->
<%
Response.Write("<a href=""javascript:openInMainWin('email_messenger.asp?SEID=" & lngProfileNum & "')""><img src=""" & strImagePath & "email_button.gif""  border=""0"" align=""absmiddle"" alt=""" & strTxtSendEmail & """></a>")
%>


Now, does any1 have any idea what else should I also add so that when some1 clicks on this link they could send an email....same as in forum.Confused

Thanks,Smile



-------------
Urko


Posted By: ub3rl337ch3ch
Date Posted: 19 February 2006 at 10:02pm
an actual count field would be messy... you'd have to remember to drop it one if you deleted a record manually...
 
alternately, you could use "SELECT COUNT(id) as countid ...blahblahblah"



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net