A
A
Anton2016-09-06 16:40:42
Yii
Anton, 2016-09-06 16:40:42

How to make where from another table using ActiveRecord?

Hello. There are two tables let's say tbl1 and tbl2 in which tbl2 refers to tbl1. How can I do something like this
Tbl2::find()->where(['tbl1.field' => 1]);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2016-09-06
Reytarovsky @Antonchik

Good evening.
Use relationships
Working with related data
or ibid
Using JOIN with relationships

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question