Help create a search condition
SELECT *
FROM mlt_adr_city
WHERE name LIKE "Text%"
AND region_id = 59
AND id <> 0
IF (name = name, LIMIT 1, LIMIT 5)
Value field name can coincidence.
If the value is the same output a single line, or five.
Sorry i am bad english
[copied from comments:]
If the request without the condition, the names in which the records are repeated. For example WHERE name LIKE "City1" with the same name will return five rows but id they will be different.
But if there is no match then display five records.
Example Search LIKE "City1%"
display records three City1, City1, City1.
Example 2. Search LIKE "City2%"
display records three City2, City2, City2_en, City2_rect, City2_les.