FetchAll will return a Zend_Db_Table_Rowset, you can convert this to
an array with:

$myrowset->toArray();

And encode it with Zend_Json.

2009/1/25 sktib <[email protected]>:
>
> Folks,
>
> I am new to Zend and Dojo so stumbling around a little.
>
> I am trying to populate a ComboBox from data in a table that has two columns
> - id and name.
>
> I have gotten all the data through a fetchAll() call on an instance of the
> model that represents the table. I need to convert that data to JSON so that
> it can be attached to the ComboBox ItemFileReadStore.
>
> I would think there is a simple function call to go from the data I have
> from fetchAll to a JSON format output. I have been searching around for a
> function that will help me do that but I haven't found one.
>
> Would appreciate any help in how best to convert the fetchAll data records
> into JSON to be sent to ItemFileReadStore.
>
> Thanks,
> -S
> --
> View this message in context: 
> http://www.nabble.com/Converting-DB-fetch-to-JSON-for-ComboBox-population-tp21648878p21648878.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>



-- 
----------------------------------------------------------------------
[MuTe]
----------------------------------------------------------------------

Reply via email to