By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,722 Members | 1,227 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,722 IT Pros & Developers. It's quick & easy.

ADO: .movefirst ?

P: n/a
Hi,
Question : How can I iterate more than once over a query resultset ?

Usually this is how I connect to my odbcdatabase (classic stuff) :

$object=odbc_exec($con,$sql);
while ($row=odbc_fetch_array($object) {

blablah;

}

Now suppose I want to loop through it again, how do I reset the pointer to
the beginning ?
I realize doing $row[]=odbc_fetch_array is an option.
thx

Ward

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Mon, 27 Sep 2004 09:11:14 GMT, Ward <ki************@for.president.com>
wrote:
Hi,
Question : How can I iterate more than once over a query resultset ?

Usually this is how I connect to my odbcdatabase (classic stuff) :

$object=odbc_exec($con,$sql);
while ($row=odbc_fetch_array($object) {

blablah;

}

Now suppose I want to loop through it again, how do I reset the pointer
to
the beginning ?
I realize doing $row[]=odbc_fetch_array is an option.
thx

Ward


Afaik, odbc_exec (preferably using odbc_prepare) or your suggestion are
the alternatives you have.

Using postgre you could use pg_result_seek..

--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.