0
와 form_dropdown 채우기 I 다음 선택 상자가 : 옵션의foreach는 (CodeIgniter를)
<?php echo form_dropdown('select-something',$options); ?>
나는 내가 $ 옵션 배열에 추가하여 한 쿼리의 결과를 표시하기 위해 노력하고 있습니다. 예 :
$options = array(); //which should be like 'option1'=>'foo',
foreach($queryExample->result() as $example){
$options[$example->id] = $example->name;
}
것은 form_dropdown 나에게 오류를주고있다 :
Cannot use object of type stdClass as array...
Travis, shure 필요할 경우 이동하십시오. –
'$ queryExample'을 설정하는 곳에 코드를 게시하십시오. – Catfish
파일 이름과 줄 번호를 포함한 전체 오류 메시지는 무엇입니까? –