Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - show # of records next to categories
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

show # of records next to categories

 Post Reply Post Reply
Author
urko View Drop Down
Groupie
Groupie
Avatar

Joined: 23 September 2004
Location: Slovenia
Status: Offline
Points: 160
Post Options Post Options   Thanks (0) Thanks(0)   Quote urko Quote  Post ReplyReply Direct Link To This Post Topic: show # of records next to categories
    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
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post 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 - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
urko View Drop Down
Groupie
Groupie
Avatar

Joined: 23 September 2004
Location: Slovenia
Status: Offline
Points: 160
Post Options Post Options   Thanks (0) Thanks(0)   Quote urko Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post 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"
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.