Class: ADORecordSet_mysql Easy way to get an Array indexed by id of row

依然范特西╮ 提交于 2019-12-22 11:33:48

问题


I have a table with a primary key called 'id' and I am using ADODB and getting a ADORecordSet_mysql back. I need an array where the id is associated with a row in the result set, but ADODBRecordSet_mysql only seems to have a GetArray(int startingRow) method that returns an array indexed by startingRow (where the default is 0).

I don't want to have to iterate through this result set an associate the id's to each row myself and I don't like the idea of having to pass into GetArray a starting index. I would rather be able to get the array back with it indexed using my primary key.

Is this possible or is my head in the clouds?


回答1:


http://phplens.com/lens/adodb/docs-adodb.htm#getassoc1



来源:https://stackoverflow.com/questions/3249121/class-adorecordset-mysql-easy-way-to-get-an-array-indexed-by-id-of-row

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!