I would like to use something like the following:
SELECT city FROM cities WHERE city LIKE %D% AND country_id = '12'
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to quote the string
But remember that using a LIKE with a pattern starting with a “%” means the server will NOT use an index on ‘city’ column – it may not matter in your specific case but something to be aware of. Here’s the reference since your comment indicates you’re not familiar with indexes.