类:ADORecordSet_mysql获取按行ID索引的数组的简便方法 [英] Class: ADORecordSet_mysql Easy way to get an Array indexed by id of row

查看:142
本文介绍了类:ADORecordSet_mysql获取按行ID索引的数组的简便方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有名为'id'的主键的表,并且正在使用ADODB并获取ADORecordSet_mysql.我需要一个数组,其中id与结果集中的一行相关联,但是ADODBRecordSet_mysql似乎只具有一个GetArray(int startingRow)方法,该方法返回一个由startingRow索引的数组(默认值为0).

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).

我不想遍历此结果集而自己将ID与每行关联,而且我不喜欢必须将起始索引传递给GetArray的想法.我宁愿能够使用主键对数组进行索引.

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?

推荐答案

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

这篇关于类:ADORecordSet_mysql获取按行ID索引的数组的简便方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆