Author Topic: MySQL database structure ??  (Read 245 times)

mdahlke

  • Senior Member
  • ****
  • Posts: 179
  • Karma: 7
    • View Profile
    • Rummage City!
MySQL database structure ??
« on: July 12, 2012, 09:40:41 PM »
I would like to create a database that I guess would kind of be like how craigslist has theirs (I assume).

I don't want people to list items for sale though, I just think that their structure would work best for me.

Can someone tell me how they would structure it?

I would like State -> County -> City -> then from there a posting containing $title, $date, $location, $items, etc...

I would also like to display the city underneath the correct county.

I'm not asking for the code for this I am just asking for a starting point (basically the structure of it).

Any help is very appreciated
« Last Edit: July 12, 2012, 10:04:39 PM by mdahlke »
If I help you out why not bump up my Karma a bit?

Andrew

  • iPhone Application & Web Developer
  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 339
  • Karma: 9
  • PHP, MySQL, HTML, and CSS are my playground
    • View Profile
Re: MySQL database structure ??
« Reply #1 on: July 13, 2012, 05:46:56 PM »
I would create a series of tables.

1 Cities
2 States
3 Counties

Then I would create a master relations table for those three tables with the FKs to each entry

so California:Orange County:Los Angelas would be 1:1:1 in my master table assuming that california's FK was 1

then your final table would be an FK to your master relations table and the title, date, location information

all told about 5 tables I think.
You cannot solve a puzzle if you don't have all the pieces.
Please + my karma if I helped you. <-- over there under my picture.