How to choose from different tables?

public function actionRange($table,$price_min,$price_max){
$product = $table::find()->all(); 
 print_r($product, true); } //there's nothing but if $product=Nike::find()->all(); everything works

I have the clothing brands in different tables(nike and adidas) I will refer to the appropriate table
Please help
June 10th 19 at 14:58
1 answer
June 10th 19 at 15:00
I have the clothing brands in different tables(nike and adidas)

What is the crutch? You better rearchitect database to normal, and not asking to invent a crutch for Your problem
You want to say that I joined these tables but if I have many brands and each with 1000 items, the search will be delayed - maxie.Schiller44 commented on June 10th 19 at 15:03
You need to have
product: id | tilte | brand_id
brand: id | title
Then the question would not arise, but as You did I can't even imagine, so get your table. - Henderson_Beat commented on June 10th 19 at 15:06
Yes. even if you have 1000 brands, 1000 products each, it's only 1000000 of goods, not so much for modern databases + add index solves the speed problem. - bryana.Renn commented on June 10th 19 at 15:09
Thank you for your prompt response then remake the table - maxie.Schiller44 commented on June 10th 19 at 15:12
Thanks for the tip - maxie.Schiller44 commented on June 10th 19 at 15:15

Find more questions by tags Yii