I have the following sample table and attributes:
--------------------------- | Name | Town | --------------------------- | Name 1 | POOLE | | Name 2 | POOLE/WALLASEY | | Name 3 | POOLE/WALLASEY | | Name 4 | POOLE | ---------------------------
I use the following SQL statement in PHP to retrieve rows:
SELECT * FROM `table` WHERE `Town` LIKE '%".$global->getPlayerTown()."%'
Given the POOLE criteria, the database returns:
--------------------------- | Name | Town | --------------------------- | Name 1 | POOLE | | Name 2 | POOLE/WALLASEY | | Name 3 | POOLE/WALLASEY | | Name 4 | POOLE | ---------------------------
However, when using the POOLE/WALLASEY query returns:
--------------------------- | Name | Town | --------------------------- | Name 2 | POOLE/WALLASEY | | Name 3 | POOLE/WALLASEY | ---------------------------
How can I reasonably tell PHP to split a string into separate criteria (i.e. POOLE and WALLASEY ) in one query so that the query retrieves all the rows?
source share