What is "Fetching rows with a scrollable cursor" all about?
A scrollable cursor is cursor that can be moved in both a forward and a backward direction. Scrollable cursors can be either row-positioned or rowset-positioned.
PDO is a lean, consistent way to access databases. This means developers can write portable code much easier. PDO is not an abstraction layer like PearDB.
PDO::FETCH_NUM. Returns an array indexed by column number as returned in your result set, starting at column 0. PDO::FETCH_OBJ. Returns an anonymous object with property names that correspond to the column names returned in your result set.
Fetch data from a result set by calling one of the following fetch methods: To return a single row from a result set as an array or object, call the PDOStatement::fetch method. To return all of the rows from the result set as an array of arrays or objects, call the PDOStatement::fetchAll method.
It creates a cursor for the query, which allows you to iterate over the result set without fetching the whole result at once. A scrollable cursor, specifically, is one that allows iterating backwards.
Example use: You can scroll forward until you find the record you need and iterate back to fetch the previous records, if you need them, too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With