I'm using PHP to execute MySQL commands.
I have a MySQL table that consists of two fields:
id, product_title
each product has its own id and rows look like this:
1, "this is product widget number one"
2, "this is product widget number two"
3, "this is product widget number three"
4, "this is product widget number four"
I have HTTP_POST_DATA which look for matches within "product_title", so my query is:
this works for simple queries, i.e. if types in only "widget" it gives me all 4 rows with with "widget" in it but if someone is looking for "widget four" it doesn't give any results since the word "number" is between "widget" and "four".
how can I achieve it to get results with such queries?
I have a MySQL table that consists of two fields:
id, product_title
each product has its own id and rows look like this:
1, "this is product widget number one"
2, "this is product widget number two"
3, "this is product widget number three"
4, "this is product widget number four"
I have HTTP_POST_DATA which look for matches within "product_title", so my query is:
Code:
SELECT * FROM table WHERE product_title LIKE '%$searchstring%'
this works for simple queries, i.e. if types in only "widget" it gives me all 4 rows with with "widget" in it but if someone is looking for "widget four" it doesn't give any results since the word "number" is between "widget" and "four".
how can I achieve it to get results with such queries?