MYSQL Query Help - Comma Seperated Values

Associate
Joined
19 Mar 2005
Posts
569
Just wondering if any of you can help me out with my query to find employees expertise, employees expertise is a text field and I have a search box where you can search for employees with relevant expertise. The problem I am having is employee can have more than one type of expertise either separated by a space, comma, full stop etc. I would like to be able to search for more than one term no matter how it is split up in the expertise e.g. by comma, full stop, space etc

Would like it to catch all of these if the terms shooting passing were entered
  1. Shooting Passing
  2. Shooting, Passing
  3. Shooting and Passing
  4. Shooting. Passing.
  5. Shooting; Passing
I think I need a regexp to catch all of these



The code I currently have is below, this is ok for when i enter "shooting, passing" but not "shooting passing".
Code:
 $sqlExpertise=mysql_query("SELECT * FROM staff WHERE FIND_IN_SET('$searchValue',expertise)")or die(mysql_error());

Just wondered if anybody could help me redefine my search?
 
Thanks for your replies unfortunately the expertise field is a text field and I cant change this, an example is below of the data. It is the responsibility of each engineer to enter his own expertise areas in the field which could be anything so would struggle to use drop downs.

Sample Expertise Text For An Employee
Product information on model planes, Product and drawing issues on Tyco units, Secretary of Tyco Long Service Association

What I would like to be able to do is say enter "Tyco, Planes, Association" and then the above record would be found and any other records containing one of the terms "Tyco, Planes, Association" found aswell?
 
Back
Top Bottom