Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is PDO scrollable cursor?

Tags:

What is "Fetching rows with a scrollable cursor" all about?

like image 986
Alex L Avatar asked Jul 20 '09 18:07

Alex L


People also ask

What is scrollable cursor?

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.

What do you mean by PDO?

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.

What is PDO :: Fetch_obj?

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.

How to FETCH data using PDO in PHP?

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.


1 Answers

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.

like image 112
soulmerge Avatar answered Sep 30 '22 19:09

soulmerge