PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Iron Speed
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old May 5th, 2008, 02:56 PM
Kay Kay is online now
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 5 Kay User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 33 m 42 sec
Reputation Power: 0
Question Mysql & other databases - Organizing Categories

I have a bit of a puzzle I'm trying to figure out....I was wondering if anyone might be able to help me sort it out....or in the direction.

I have 11 main categories and about 185 sub categories that may appear in one or more main category.

In the sub categories are companies.

The user will enter the site and search by postal code. I want to only show the categories & sub categories that have a company with that postal code.

I'm just having trouble figuring out how i should set up my databases.

Any guidance or help would be greatly appreciated... I hope this made some sense.

Thanks.

Reply With Quote
  #2  
Old May 5th, 2008, 03:35 PM
dykebert dykebert is offline
Contributing User
Click here for more information. Click here for more information
 
Join Date: Apr 2008
Posts: 83 dykebert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 6 h 37 m 39 sec
Reputation Power: 1
OK Here's the basics tables I would create.

tblCategory with a primary key and the category info.
tblSubCategory with a primary key and the category info.
tblCompany with a primary key and the company info.
tblAssocCat_SubCat with a primary key and two fields for the Category and SubCategoy keys
tblAssocSubCat_Company with a primary key and two fields for the SubCategory and Company keys

then build a stored query to give you the zips for a SubCategory:

SELECT Distinct SubCatID, ZipCode
FROM tblAssocSubCat_Company INNER JOIN tblCompany on tblAssocSubCat_Company.companyID = Company.companyID

That should get you started.

Reply With Quote
  #3  
Old May 6th, 2008, 12:57 PM
Kay Kay is online now
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 5 Kay User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 33 m 42 sec
Reputation Power: 0
Thanks for the help

ok i have the category table with my 11 categories and my sub category as well as the company table


How do you get the keys from those into those other tables...i'm a little confused

Reply With Quote
  #4  
Old May 6th, 2008, 01:20 PM
dykebert dykebert is offline
Contributing User
Click here for more information. Click here for more information
 
Join Date: Apr 2008
Posts: 83 dykebert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 6 h 37 m 39 sec
Reputation Power: 1
There are a couple of different ways to do it. It depends on what raw data you have.

1. you can create a form to manually assign the sub Categories to the categories and the companies to the categories.
2. if you have an excel spreadsheet with the info , or can easily get the info into an excel spreadsheet, you can use it to do the association.

Which you do depends on how the Categor, Sub Category, and Company data will be maintained.

If you will be keeping it all in the DB then option 1 is your best choice, otherwise option 2

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Mysql & other databases - Organizing Categories


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway