I have a table with products in domain name, I need to be able to select the correct product based on domain name matching.
For example, if the domain is google.co.uk it should return the product that is Domain Name Purchase (.co.uk) however if the domain is google.uk it should be Domain Name Purchase (.uk)
How can I make sure I select the correct product when they are similar?
I have tried this query:
SELECT * FROM `prices` WHERE 'google.co.uk' like CONCAT(product, '%')
I also tried:
SELECT * FROM `prices` WHERE product LIKE '%google.co.uk%'
The second query works fine. However if the query is searching for a match with .uk, it will also return products matching .co.uk.