Hi I have a sql statement but not sure how to bind it properly.
//$id = Array
(
[0] => 1
[1] => 2
[2] => 3
)
$sql = 'SELECT name FROM user WHERE id IN(1,2,3)';
$cmd = Yii::app()->db->createCommand($sql);
$result = $cmd->query();
How would I remove hardcoded (1,2,3) and replace it with and bind my own array $id (structure shown above)?
Thanks