Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
In Craft 2 you could creat a query with:
craft()->db->createCommand()->select() .... etc.
But in Craft 3 there is no select() Method in Craft::$app->db->createCommand().
Am I overlooking something?
You can use either an activeRecord for it
$customer = Customer::find()
->where(['id' => 123])
Or a query
$rows = (new \craft\db\Query())
->where(['last_name' => 'Smith'])
return $this->renderTemplate('path/to/template' ['data' => $rows])
return $this->asJson(['data' => $rows]);
Required, but never shown