Anyone have a createCommand example?
I'd suggest reading through the Yii QueryBuilder docs, which is what the code you've written is using.

-&gt;from('{{ assetfiles }}')


should be:

-&gt;from('assetfiles')


And if you want multiple rows returns as a a result, you need to add a:

-&gt;queryAll();


to the end of the statement.

From there, you can do a foreach loop to access the results of your query:

foreach ($query as $row)
{
    $id = $result['id'];
}