O
O
Oversec2016-10-10 09:07:48
Yii
Oversec, 2016-10-10 09:07:48

How to check the correct entered city?

There are two tables: applications and cities.
How can I check when creating an application whether there is a city id in the database entered when creating an application? It is necessary to highlight an error in the absence of a city in the database. The problem I had was that the id of the cities is in another table and I had difficulties with this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2016-10-10
@Oversec

use ExistValidator for this purpose

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question