1

does someone know how is devrants tagging system coded? im asking about sql code. if 1 user can create multiple posts and each post can have multiple tags, how many tables do i need to have? asking bc i need to code the same thing

Comments
  • 0
    @Artemix ok i figured, i was in doubt if i should have 3rd table. what columns do i put in tag and post_tag relation?
  • 0
    @Artemix wait post_tag relation has 2 primary keys? why
  • 0
    📌 I can help explain relational db systems in a bit, but I dont want to type it all out on mobile
  • 0
    @tokumei i learned it in highschool but i forgot the whole concept. a quick refresher would help, leave me your email

    thanks @Artemix @tokumei
  • 0
    @Artemix ok i dont understand at all, i tried to implement it.

    1 post can have multiple tags.

    in my posts table, i dont have any tag_id because i think i dont need it

    in my tag table, i have tag_id and a label.

    in my post_tag table, i have a primary key composed of tag_id from tag table and post_id from posts table.

    when a user in the app adds like: music, nature, photography as a tag, where does that get added? into tag or post_tag table? if it gets added to tag table, then what do i do with post_tag? and vice versa.

    is tag table supposed to add all possible tags from all posts in the app?

    can you help me structure this on teamviewer so i can understand it morr clearly?
  • 0
    @Artemix Can you tell me where do i insert data when a new post with tags is created?
  • 0
    @Artemix sure, estavex@gmail.com
Add Comment