I am trying to get a Select statement to work, I have a table(districts) with Names field and I only want to return a name if it is contained in a text field in another table.
Something like this.
SELECT name FROM districts,users
WHERE users.accesslist LIKE '"%"+districts.name+"%"'
This returns an empty list.
I can get it to work if I use a specific name %Swindon% so is it my concatenation that is wrong?
Looks like it is. Use
CONCAT("%", districts.name, "%")