I am making a database for a client where I will have an Account and in that account I want to have the post’s of that account along with the post’s data (likes, comments). How could i store the posts (along with their data) in the database?
Share
Lets suppose you have this data to handle (accounts,posts,likes,comments) you should create a different table for each of these ‘objects’.So you will have:
where the ‘id’ fields are AUTO-INCREMENT index and the fields followed by the ‘FK’ are foreign keys.
If you’re not sure what a foreing key is give a look here doc
try being more detailed next time if you need an answer that goes straight-to-the-point!
Hope it helps