query with parameters

I am trying to run this code but it does not work, what is wrong?


 $sql="select cat_id from cats where cat_link=':links'";

 $command=Yii::app()->db->createCommand($sql);

 $dataReader=$command->query(array (':links'=>$_GET['cat']));

I wrote this and it worked, is this right?.


$sql="select cat_id from cats ";

$command=Yii::app()->db->createCommand($sql);

$dataReader=$command->query(array ('cat_link'=>$_GET['cat']));

[edit]The code that worked were that


$sql="select cat_id from cats where cat_link=:link ";

$command=Yii::app()->db->createCommand($sql);

 $dataReader=$command->query(array (':link'=>$_GET['cat']));