Need Some Advice on Collections and Search Features..

This is a discussion on "Need Some Advice on Collections and Search Features.." within the PHP Forum section. This forum, and the thread "Need Some Advice on Collections and Search Features.. are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 17th, 2008, 20:05
JustinStudios's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: USA
Posts: 406
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to JustinStudios
Need Some Advice on Collections and Search Features..

Not sure if I am doing this correctly and I want to make sure that it is done right. What I am doing is making a website for a client that wants users to be able to add articles to a collection. Their are 4 separate types of collections that can be added and they have a hierarchy like this:

Magazine - Issue -[Pattern] / [Article]

I'm wanting these to appear like this when searched for:

+ Magazine Name
- Issue
-Pattern/Article
-Pattern/Article

I have the database designed with tables for each Category on it's own AND a members table. I use the collections table to link these 3 tables by ID. Also in the collections table I use a char named "Type" to determine whether it is a Magazine, Issue, Pattern, or Article. I then call the Collections table and then I need to pull data from the Members table, then pull data from the Issues table, and it gets into a nasty mess. I know in Access you can create relational databases and was wondering how to do this with php / MySQL to fix my nightmares. I have searched my sources and haven't found anything on it more than opening up new connections constantly and I really don't want to do that. Any tips/suggestions before I go crazy?
Reply With Quote

  #2 (permalink)  
Old Jan 18th, 2008, 06:33
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Need Some Advice on Collections and Search Features..

At first glance I would think you're overcomplicating it a bit.

Can you explain a bit more about what you need and what each of the articles will contain etc.. I think I can offer you a better way to lay out your database.

MySQL doesn't enforce foreign keys as some other databases do (Access for eg.) but a well designed database will have logical relational foreign keys.. by having a column with a character representing the type signals that you aren't using foreign keys effectively.

Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
  #3 (permalink)  
Old Jan 18th, 2008, 18:15
JustinStudios's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: USA
Posts: 406
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to JustinStudios
Re: Need Some Advice on Collections and Search Features..

Well this is a collection where users can add things to their collection.

They have the ability to add issues (of a magazine), which is just basic information about an issue with links to all of the articles and patterns that were in that issue, or add individual articles / patterns from that issue to their collection. All of that works ok with the setup I have now, but the problem comes in displaying the collection information.

If they have an issue in their collection I connect to the Issues database and find out what Magazine it is from (by using the Magazine's table foreign key). I then save the information from the issues to variables and then go and connect to the Magazine table and grab the magazine name from there. I then display Magazine name and Issue information from variables. But if the user also has patters / articles, I have to go back and check if those are from the same issue as the previous, if not, I have to check if it is from the same magazine as the previous, if not then I have to go find out what issue it is from so that I can get the magazine name.

This is where I am having my problems. While everything is tied together with keys I am at a loss as to what to do to get this information without using so many connections. I have attached an Excel file that shows the necessary tables from the database. The unused tables were deleted from this file.
Attached Files
File Type: zip data.zip (3.4 KB, 1 views)
Reply With Quote
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
what features Hunter Hosting & Domains 12 Dec 5th, 2007 13:58
Basic Search Engine Optimisation Advice :: Readme Rob Search Engine Optimization (SEO) 1 May 3rd, 2007 14:53
search engine optimisation advice samjones Link Building and Link Sales 2 Aug 21st, 2006 04:04
One Log-In Different Features... courtjester Classic ASP 7 Jul 26th, 2004 19:54


All times are GMT. The time now is 02:10.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43