hi guys , I need to create a database to use with a website where users create/delete and share posts. I would like to know what do you think would be the best way to create the database.
E.g. There should probably be a db with a table for users , posts etc. and if so , how do I go about in linking the 2 , e.g. linking the user with his posts ?
I am writing the whole website from scratch and want to start of in the right direction.
T.I.A.
Databse creation
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Databse creation
Foreign keys. Simple example:janpan wrote:how do I go about in linking the 2 , e.g. linking the user with his posts ?
----------------------------------
user_tbl
----------------------------------
id, user_id, name
---------------------------------
post_tbl
---------------------------------
id, post_id, user_id
If a user makes a post, his id (user_id) is placed inside the post table.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: Databse creation
Awesome ! Helps a lot .
Thx
Thx