Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Display a single category?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Display a single category?

 Post Reply Post Reply
Author
CapnCrunch View Drop Down
Newbie
Newbie


Joined: 03 June 2004
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote CapnCrunch Quote  Post ReplyReply Direct Link To This Post Topic: Display a single category?
    Posted: 03 June 2004 at 12:57pm

http://www.cpca.org/healthcollabs/forum/default.asp?C=3

 

As you can see from this link, what I am trying to do is get ONLY the toolbox category to display. Is there an easy way to do this?

 

Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 04 June 2004 at 6:03pm

the way i would do it have an identifier (c=3) and if that exists only call the category

the below should help you impliment what you want

-----------------------

just above the <html> tag of the default.asp page you will see the following code

'Read the various categories from the database
'Initalise the strSQL variable with an SQL statement to query the database


If strDatabaseType = "SQLServer" Then
 strSQL = "EXECUTE " & strDbProc & "CategoryAll"
Else
 strSQL = "SELECT " & strDbTable & "Category.Cat_name, " & strDbTable & "Category.Cat_ID FROM " & strDbTable & "Category ORDER BY " & strDbTable & "Category.Cat_order ASC;"
End If

(this method will only work on Access version)

chage the section of code for the below section

'Read the various categories from the database
'Initalise the strSQL variable with an SQL statement to query the database
If strDatabaseType = "SQLServer" Then
 strSQL = "EXECUTE " & strDbProc & "CategoryAll"
Else


 strSQL = "SELECT " & strDbTable & "Category.Cat_name, " & strDbTable & "Category.Cat_ID FROM " & strDbTable & "Category"

intQueryCatID = CLng(request.querystring("c"))

if intQueryCatID > 0 then strSQL = strSQL & " WHERE " & strDbTable &"Category.Cat_ID =" & intQueryCatID &""

strSQL = strSQL & " ORDER BY " & strDbTable & "Category.Cat_order ASC;"
End If

the above code will check to see if there is a selection and if so it will only get the selected category and none of the others.

I hope /think that is what you want. the above code should be copy and paste.

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.