Jump to content

Need some database structure help - advanced issue


simcoweb

Recommended Posts

I'm creating a classified ads system for a client. There will basically be 6 types of ads:

 

Services

Housing

Jobs

Personals

Gigs

For Sale

 

Each has it's own set of questions in the registration form but there are also some common questions. For example, all have these:

 

Title

Location

Price

Description

Email

Email Use (3 choices on how the people would respond)

 

The 'Housing' ads have price but the 'Jobs' ads use compensation as the title. Some ads allow images like housing, personals, and for sale. But jobs, services and gigs do not.

 

The question I have is about structure. Should I have one table called 'ads' that holds all these fields and deal with the insert queries accordingly. Or, should I have separate tables for each kind of ad so that the queries are specific to that table?

 

There would need to be a few 'connected' fields as well that would be present in all the tables. They would be:

 

ad_id

cat_id

subcat_id

confirmation_status (I will be requiring that they 'activate' the ad by responding to a link. Default is 0 while activated would be 1)

date_created

date_expired

 

I'm looking for some guidance about the most efficient way to construct this from anyone who has had experience with this type of thing. Thanks in advance!

Link to comment
Share on other sites

i would use a seperate table per division. and an extra for your cat id etc. The more tables the merryer.

 

as with the registration, just make a switch statement, checking what division the user is part of. Therefore getting echo'd the correct forms.

 

Snooble.

 

(Big project, like building 6 sites!)

Link to comment
Share on other sites

Snooble, thanks for your post and suggestions. Initially that's the way I had it set up...multiple tables. One table for each 'type' of ad. That means, though, that I need to create 6 separate form parsing scripts. Although they are similar they have the slightest differences. Once I get the 'master' form done then the others could be derived from it.

 

Ok, so in the ad registration, basically the way it would work is kind of like adding your site to Yahoo or DMOZ where first you have to navigate to the sub-category and then the Post Your Ad link will be there. I can snag what sub-cat it is via the $_GET in the URL. With your suggestion, then, you'd say using a switch statement at that point would then determine what form shows. Is that what you meant?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.