Jump to content

searching the database


akurtula

Recommended Posts

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

Link to comment
Share on other sites

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,

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...