问题
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