views:

543

answers:

1

Hello, I have a result array fetched form database. it's structure ion print_r is like this :

Array ( [id] => 1 [code] => MSjoo7 [description] => Hello World [Organization_id] => 1 )

Now i want to set these fetched values in my Zend Form's elements some think like this:

Code: MSj007
Description : Hello World

http://yfrog.com/0jscreenshotxlsp

For getting above output i also used : $Form->populate( $result_array); but the browser does not show any thing. Plz Help me...

+1  A: 

Hurrra.. Thanks to Allah I get success.

We only need to add

$grades = new Default_Model_Grade( );//create object of grade table in my db
$code = $grades->getGradesByOrganizaton( 1 );//call method of grade class
$form->populate($result[0]->toArray());//fetch all rows from db and then populate

In controller file. But the form fields id must be same as defined in database.