Forum Moderators: open

Message Too Old, No Replies

Select partial text from MySql field

         

dertyfern

6:45 am on May 31, 2008 (gmt 0)

10+ Year Member



I'm trying to select and display partial text from a field.

Example:

Grab text from the first instance of "Cheap cars" until "."

Tried the following sql but it only displays partial info and doesn't begin the display given the requirement I've stated above.

Any ideas would be appreciated.

SELECT description, SUBSTRinG(description, LOCATE(description, 'cheap cars')-100, 30) as description, match(description) against ('cheap cars') as score from tbl_2 where match (description) against ('cheap cars')