signature16 Posted November 13, 2007 Share Posted November 13, 2007 I created a very simple shoutbox. User posts their name and a message and clicks post. It posts to the database and when the page reloads, the "shout" is displayed. I would like to add categories to this little shoutbox application I created. The user should be able to check off boxes to apply different categories to a post. For example a shout could be in the categories, php,mysql,html and css. Logistically how do I do this using MySQL and PHP? ... Obviously this is just a project for learning and has no real application. Thanks. Quote Link to comment Share on other sites More sharing options...
signature16 Posted November 13, 2007 Author Share Posted November 13, 2007 bump? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 13, 2007 Share Posted November 13, 2007 there is about a million ways to do this. 1 make a static array in php 2 make an mysql table of them and query them 3 make a mysql table and then use an enum field for optimized storage 4 make the second mysql table store then as integers in the new one and use a psedo enum on output. 5-1million any varieation on the above or what ever you like Quote Link to comment Share on other sites More sharing options...
signature16 Posted November 13, 2007 Author Share Posted November 13, 2007 Ok lets say I am going to go with option 2... or at least definitely not option 1. Do I create two tables? .... one for the posts (id,title,categories,message) and one for the categories (id,category,description)? This is where I get confused. Once I have two tables what do I do? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.