Jump to content

Extract words from a returned recordset and return it.


watsmyname

Recommended Posts

Hello,

 

Let's say my database table field has following rows

ID        TITLE

1      2008 Toyota Tundra 2WD Truck at 12664 W. Colonial Drive.

2      2007 Toyota Corolla at 8629 US Hwy 441.

3      2007 Toyota Corolla at 8629 US Hwy 441.

4      2007 Toyota Camry at 8629 US Hwy 441.

5      Venza Toyota at affordable price

6      Rav4 Toyota 4WD

and so on

 

a user is given an input field to type  a search keyword. Let's say he types "toyota". Now all i want to do is  return a record with two words in it, one word being toyota and another being a word that comes before or after toyota. So results should be like this,

Toyota Tundra, Toyota Corolla, Toyota Camry, Venza Toyota, Rav4 Toyota

 

Excluding other words from the returned database field.

 

HOw can this be performed?  Any help would be appreciated.

 

Thanks

Sabin

You will be best to follow Brands suggestion, otherwise you are going to need a huge amount of contional code to extract what you are looking for.  Another reason would be that the table is clearly not designed properly if that is how the information is stored and what you are wanting to retrieve from it.

well thanks for the reply

 

These are the example of autos only, there could be restaurant related items, clothings, etc. All i want to do is search in title and extract words like Toyota Corolla, Sony Erricsson, Calvin Klein, etc and discard other words from the title row returned. The tables are not specific to vehicles. This can be achieved via PHP i know, but i have to do it in MySQL.

 

Thanks.

watsmyname

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.