Best way to store and search keywords for a record in PHP and MySQL?

T I P

New Member
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... \[code\]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*/\[/code\]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
 
Back
Top