MySQL Help with storing data [closed]
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?
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:
TABLE accounts (id,name,email..)
TABLE posts (id,title,text,account_id[FK]..)
TABLE likes (id,value,post_id[FK])
TABLE comments (id,tect,datetime,post_id[FK])
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
精彩评论