I would like to use something like the following:
SELECT city FROM cities WHERE city LIKE %D% AND country_id = '12'
I would like to use something like the following:
SELECT city FROM cities WHERE city LIKE %D% AND country_id = '12'
You need to quote the string
SELECT city FROM cities WHERE city LIKE '%D%' AND country_id = '12'
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.