Not reliably before v155.
Why exactly are you wanting to rewind to start?
Not reliably before v155.
Why exactly are you wanting to rewind to start?
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
A little bit messed up - will start thinking straight after aligning with ZenCart db-procedures.
The syntax is definitely much easier after upgrading to v155:
And also supports proper Iterator and Countable actions such as reset(), count(), as well as Move(0) and more.Code:$sql = "foo"; $result = $db->Execute($sql); foreach ($result as $row) { echo $row['fieldname']; }
... but you need at least v1.5.5 to have these available.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Ok, Thanks.
Really? I've been using the following construct for a couple of years now to "rewind" a previously-processed query back to the beginning:
Code:$result = $db->Execute (<some sql query>); while (!$result->EOF) { ... $result->MoveNext (); } ... // ----- // "Rewind" the query to re-process ... // $result->Move (0); $result->MoveNext (); while (!$result->EOF) { ... $result->MoveNext (); }
As suggested here, "reliability" (backwards compatibility to before ZC 1.5.5) can be obtained by testing for the method rewind as suggested by DrByte:
Code:$result->Move(0); if (!method_exists($result, 'rewind')) { $result->MoveNext(); }
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...