Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Matt Campbell
9,767 Points2 blogs and a store on one site...mySQL and databases etc.
Just wandering how this should all be set up.
Should I set up a database for each blog and one for the store and then do a set of config files and admin "internal" sites for each blog and the store?
Or,
should I have one database and just prefix the tables to match the blog and store and then obviously I'd only need one set of post control pages, login etc.
The second one sounds like the best idea to me, just wandering if it is difficult to implement or the standardised practice is a database for each thing that requires one.
3 Answers
Caroline Hagan
12,612 PointsHi Matthew Campbell can I just ask why you need the 2 blogs? Just trying to understand the logic. :-)
I would think the possible solution could be to have one database, but prefix your tables for each blog and the store, e.g. blog1_whatvertable blog2_anothertable store_thecooltable
Matt Campbell
9,767 PointsHi Caroline Murphy . I've done a bit of work on this since.
The reason for two blogs is that there'll be a section for news. Announcements from the industry, upcoming releases, cool events etc. another section of the site for reviews of new releases. The two need to be kept separate due to the differing natures of the two formats.
What I've worked out is that I need one database with one table for users etc and then I just have a table for reviews and one for news. I think I'll even be able to use one table for categories shared and then similar setup for store.
Store may have a table for product type such as hardware and then games, as if the store could be two independent ones.
I feel this will keep things well organised and easy to sort and maintain.
Caroline Hagan
12,612 PointsGlad you've been progressing; I've found drawing it out helps work out your tables and their relationships :-)
For the benefit of you and others, here are some links I saved when I was learning:
An Introduction to MySQL 5: Views
Description of the database normalization basics
Quick Tip: Working with MySQL and INNER JOIN