Jump to content

SQL search only looks art the first word


Recommended Posts

I've created a search box to search the inventory of product. The results page shows the select statement is like this:

 

SELECT tbID, tbName, tbItemNo, tbThumb, tbCostR FROM tbProduct WHERE tbSearch like '%s%%' AND tbCostR != 'NULL' ORDER BY tbID DESC

 

s% = the search string the visitor entered in the search box

tbSearch has a list of words describing a product

 

The search only finds the first word within the list of words in the tbSearch field of my databank.

 

How can I get the search to go through the whole list within the tbSearch field and pull out all revelent product.

 

For example.....one tbSearch field has: eagle, bird

 

The eagle comes up on the results page if you type eagle in the search box. If you type bird into the search box, nothing appears on the results page.

 

Help!

Link to comment
https://forums.phpfreaks.com/topic/2266-sql-search-only-looks-art-the-first-word/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.