Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • 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.