K
K
KevinSmash2019-03-05 16:52:46
Yii
KevinSmash, 2019-03-05 16:52:46

GridView how to display data from two tables?

Good day. There are two tables: Cities and Competition. Cities spelled out the names of cities, the average salary, and much more. The Competition contains the names of cities and the number of companies competing in this city in 3 industries. It is necessary to display this data in one table. I tried to bind, but it gives an error that the property from the second table was not found

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2019-03-05
@webinar

if two tables have the same data, it's a bad table. In your case, if there are already city names in the Cities table, then there should be cities_id in the Competition, and not the same city names that are already in Cities. So apparently before you continue you should bring the tables to normal.
The one? The only one everyone thought of?
You would show how you tried to link and what error it displays because the rest of the text is not needed at all. You have described everything except what is needed to solve the problem. Usually the code that caused the error and the error itself already contains the solution path.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question