akurtula Posted July 8, 2009 Report Share Posted July 8, 2009 hi i have created a simple shopping cart (just as a uni project). on the database i stored the items, description, a photograph (the path) and keyword. now i have created a search box as follows: $search = $_POST[searchbox]; SELECT * from shop where keyword = '$search'; ...... now the question is, if i'm selling an mp3 player, there could be a lot of key words, how would i do that, i thought having a row for each keyword, but if an item has over 20 key words, it would seem a waits of space and time to have 20+ rows in the database, so is there a way of having one row (named keyword), and in that sell have keyword1, keyword2, .... then the use would have to type one of the keywords hope im clear thanks very much Quote Link to comment Share on other sites More sharing options...
russellharrower Posted July 11, 2009 Report Share Posted July 11, 2009 why not just have one row for keywords and separate each keyword with a , if you look into a cms database like wordpress, joomla etc. you will see this is how they do it (off the top of my head) I know this is how i did it for a client. Quote Link to comment Share on other sites More sharing options...
akurtula Posted July 12, 2009 Author Report Share Posted July 12, 2009 ye i totally agree with you russellharrower . in fact that is the method (simular to wordpress) that i used. though i wanted to see if there is a way of doing it just in one cell - for example if we have a key word of "killerphp" put the user types "kilerPhP" they would not get the result as they are missing an L, 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.
Note: Your post will require moderator approval before it will be visible.