I have tested a SQL query within phpmyadmin and can get it to work as I need. basically I have a text field where someone can enter a doctors name i.e. Dr Dawson.... the field this is pulled from is called Doctors, so the query looks like:
SELECT * FROM `maindata` WHERE Doctors LIKE "dr %dawson%"
This works.... so now over to my php query, I have this:
SELECT * FROM maindata WHERE Doctors LIKE 'Dr %".$_GET['field']."%';
But this doesn't work. The initial problem is the Doctors field contains names such as;
Dr James Dawson
So if somesome searches for "Dawson" or "James" it's fine, but if they search for "Dr Dawson" it returns no values due to the James part....
Hope someone can help with the above.