1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

video tags

Discussion in 'Programming' started by justin8831, Oct 16, 2015.

  1. #1
    how do I create video tags like porn sites have???
     
    Solved! View solution.
    justin8831, Oct 16, 2015 IP
  2. #2
    Do you mean category tags? A common approach is to have TWO different database tables.

    One contains a list of all the currently valid tags using fields like this:

    table "tags"
    id -- a unique numeric identifier, it's faster to query numbers than strings
    name -- a string containing the actual tag like "latex", "lingerie", "schlampe", etc, etc...
    count -- number of items associated with the tag.

    Having a separate table of just that keeps queries of "what tags exist" and "how many items are in that tag" quick and simple. Querying the larger table containing the post/videos/whatever associated with each tag is a much longer operation due to the number of records it would have.

    the table to store which videos would have which tag would be structured something like:

    table: video_tags
    video_id -- the unique identifier for the video
    tag_id -- the id of the tag associated to the video

    If you had that structure and knew that for example "teen" had the id of 3 in the first table, a SQL query to pull up all videos associated with that tag_id would go something like this:

    SELECT videos.*
    FROM videos, video_tags
    WHERE video_tags.tag_id = 3
    AND videos.id = video_tags.video_id

    That's a very rough generic example, but is a overview of how it's done. As to actually implementing it, you'd need to figure out what server side language you are using, what database engine you are using, etc, etc... If you are just starting out, you could do far worse than choosing PHP and mySQL for the task, if for no other reason than you are FAR more likely to find people willing to help you and teach you about it. There are certainly other choices, but support and documentation for them can be a bit... iffy.
     
    deathshadow, Oct 16, 2015 IP
  3. justin8831

    justin8831 Member

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    I was gonna use php and MySQL maybe mysqli .. and thank you a lot it made sense
     
    justin8831, Oct 17, 2015 IP