Hi y’all,
I know how to perform auto complete, but this is only with pre defined arrays . Could any of you folks show me how this is done from a database.
I have tried but it’s just not going through
echo "<p>Picking from a database</p>";
$sql_a = Yii::app()->db->createCommand()
->select('first_name, last_name')
->from('tbl_people')
->queryRow();
//$query_a = mysql_fetch_array($sql_a);
$this->widget(‘zii.widgets.jui.CJuiAutoComplete’, array(
'name'=>'firstNAmes',
'source'=>$sql_a["first_name"],
// additional javascript options for the autocomplete plugin
'options'=>array(
'minLength'=>'2',
),
'htmlOptions'=>array(
'style'=>'height:20px;'
),
));
I’m quite sure there is something fundamentally wrong i must be doing; but what else can i say …
thanks in advance