Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1106029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:43:42+00:00 2026-05-17T01:43:42+00:00

I haven’t touched any code in a good 4-5 months so just getting back

  • 0

I haven’t touched any code in a good 4-5 months so just getting back into it today, usually takes me a week or so to get all the info flowing through my brain again once I take months off like that. So my project I am about to start will be a PHP/MySQL backend bookmarks database.

I want to create a nice searchable database with all my favorite websites/bookmarks. Each record will have multiple keywords assigned to it so I can easily search all my bookmarks for the term “php” and all records with “php” in there keyword column or title or otherwise will come back in a result set.

Here is my idea for the database so far…

auto_id = /*Auto incremented ID number for database*/
name/title = /*Name/title of the Website*/
description = /*brief description of the site*/
URL = /*URL to open when I click a link*/
clicks = /*increments by 1 everytime I click the link*/
date_created = /*datetime that URL bookmark was added*/
date_accessed   = /*datetime field for when last clicked on*/
category = /*category name or number to create a folder like structure of bookmarks in groups*/
sub_category = /*some categories will have subcategories (ie programming->c##  programming->PHP )*/
keywords = /*Keywords used for searching*/

This is pretty straight forward for me on how to build this system all except I am looking for help/advice on the best way to store the keywords. Each website/record I add to the DB can have 1 up to multiple keywords per site. These keywords need to be able to help with the searching part of my app. So how should I store keywords for a site in my database? I know I could just have a “keywords” row in the table and store the keywords for each record like this “php, web, etc, keyword4” so all keywords for each site are saved in 1 column but this does not seem to be the best method when it comes to searching the database.

Please tell me how you would do this part? Thanks for any help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:43:43+00:00Added an answer on May 17, 2026 at 1:43 am

    The best way to do this is to create a separate table to contain your keywords and then add an intersection (or join) table to join keywords with bookmarks.

    CREATE TABLE bookmarks (
      id INT NOT NULL,
      ... etc.
    )
    
    CREATE TABLE keywords (
      id INT NOT NULL,
      ... etc.
    )
    
    CREATE TABLE bookmark_keywords (
      bookmark_id INT NOT NULL,
      keyword_id INT NOT NULL,
      PRIMARY KEY (bookmark_id, keyword_id),
      FOREIGN KEY bookmark_id REFERENCES bookmarks (id),
      FOREIGN KEY keyword_id REFERENCES keywords (id)
    )
    

    When you insert a bookmark, you’d also insert any keywords that are being used and aren’t already in the keywords table, as well as a row in bookmark_keywords in order to join the keyword with the bookmark.

    Then, when you want to query for what keywords a bookmark has:

    SELECT k.*
    FROM keywords AS k
    LEFT JOIN bookmark_keywords AS kb
      ON kb.keyword_id = k.id
    WHERE kb.bookmark_id = [ID of the bookmark]
    

    And to query for what bookmarks share a particular keyword:

    SELECT b.*
    FROM bookmarks AS b
    LEFT JOIN bookmark_keywords AS kb
      ON kb.bookmark_id = b.id
    WHERE kb.keyword_id = [ID of the keyword]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I haven't touched sharepoint in years. If I want to setup a development environment
I haven't seen any questions relating to GNU autoconf/automake builds, but I'm hoping at
Haven't fired up reflector to look at the difference but would one expect to
Haven't done ASP.NET development since VS 2003, so I'd like to save some time
Haven't seen many Geneva related questions yet, I have posted this question in the
I haven't used C++ since college. Even though I've wanted to I haven't needed
I haven't completely understood, how to use sigprocmask() . Particularly, how the set and
I haven't programmed games for about 10 years (My last experience was DJGPP +
I haven't done a lot of .NET programming, but I've examined a few of
I haven't kept up lately with the C++ world. Exactly where do things stand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.