473,657 Members | 2,450 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can i search subcategory wise for a particular category,i want to display items

1 New Member
how can i search subcategory wise for a particular category,i want to display items.suppose user selected a particular category.I want to display all items in that category + its subcategories.

this is my table structure with 3 tables.

i need a sql query

Oct 12 '06 #1
1 1809
Mistoffeles
5 New Member
You may want to rethink your table structure, you appear to be allowing items to be cross-referenced with categories rather then belong to categories. This is only valid if you want an item to belong to more than one category, which hass a huge impact on your queries (an order of magnitude greater).

Normally, your table structure would be

Category

is parent to

Subcategory

is parent to

Item

in which case, once you had acquired the category for the item, you could then simply select all of the subcategories, and then all of the items in each subcategory of that category.
Oct 12 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
2182
by: WindAndWaves | last post by:
Hi Gurus I am keen to make a search page on a website, but I have absolutely zero experience with PHP. I am going to hire an expert, but I thought that it may pay to try it a bit first myself (I do want to learn how to do it). What I have is a search page (HTML) and an access database. Now, can someone give me some clues or links on where to start. I prefer not to install the whole PHP thing on my own computer, but just to
14
4622
by: vic | last post by:
My manager wants me to develop a search program, that would work like they have it at edorado.com. She made up her requirements after having compared how search works at different websites, like eBay, Yahoo and others. This is what she wants my program to be able to do: (try this test at different websites just for fun). At eBay: - enter the word 'television' in a search field à you will get 2155 items.
3
7265
by: Richard Coutts | last post by:
I want to create a table where the first field is a category, the second field is a subcategory to the first field, and the third field is a subcategory to the second. E.g., the category table might look like this: Toys Jewelry Sporting Goods The second field lookup table might be:
2
311
by: C# newbie | last post by:
Hi Guys, What will you suggest me as search method in an XML file ? Scenario: Purpose is finding the values first. Then using some methods the program should detect attributes, parent and even object type of the searched value. For instance: user would enter (for search purpose) "Math" only. Now, program should find it and shows it, plus it should show other related attributes like parent, subCategoryName.
60
49061
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't be indexed/sorted. I don't want to load the entire file into physical memory, memory-mapped files are ok (and preferred). Speed/performance is a requirement -- the target is to locate the string in 10 seconds or less for a 100 MB file. The...
7
3533
by: Barkster | last post by:
I'm trying to list my categories and how many items are in each category. I'm not much on sub queries. How can I combine these two items. I'd like to display the category and the corresponding number of items in each Cats: Select Category.CategoryID, Category.Category, Category.Sorting
1
3865
by: Nitin Nikam | last post by:
Hello, I m developing application of link directory using VS-2005. In this application i have a dropdownlist. In dropdownlist i want to display categories, sub-categories, sub-sub-categories upto any level (for eg. country--state--district--city--village etc.) The dropdownlist will look like Arts --camera --photography
16
2840
by: Computer geek | last post by:
Hello, I am new to VB.NET and programming in general. I have taught myself a lot of the basics with vb.net but am still quite the novice. I am working on a little application now and I need some help with one part of the code. When a button is clicked I need to have it go out to a network drive location and count how many files are present with a certain file extension. Then store that number in a declared variable. Is this possible? Can...
1
3526
by: TomLasky | last post by:
Hi everyone, I'm creating a very powerful web store script in ASP. One of the things I am adding is to allow the user to create their own categories and sub categories for items they wish to sell. This isn't a new concept or anything but what I'm doing is allowing them to create "Main or Master Categories". An example of a main category would be "Electronics". They can now create sub categories under "Electronics". If for example...
0
8421
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8325
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8742
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8518
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.