$AA = $db->prepare (' select * from user ', array (pdo::attr_cursor = Pdo::cursor_scroll)); $aa->execute (); $AA- >fetch (); $aa->fetch (); $a = $aa->fetch (pdo::fetch_num, Pdo::fetch_ori_next);p rint_r ($a);
An open cursor has been set in the prepare;
The result is the third row, not the last line;
The second parameter of all fetch is tested and is invalid;
Ask what is the reason, this is not rollback, need the table is InnoDB?
In accordance with the wording of the manual, but also not good use, it is puzzling;
Help in .... thinks;
Reply to discussion (solution)
The third line, of course, you take a closer look at the examples in the manual and the description of the function
Fetch_ori_next
Fetch the next row in the result set. Valid only for scrollable cursors.
Remove a row of result sets
Fetch_ori_prior
Fetch the previous row in the result set. Valid only for scrollable cursors.
Take the result set of the previous row
Fetch_ori_first (integer)
Fetch the first row in the result set. Valid only for scrollable cursors.
Take the first row in the result set
Fetch_ori_last
Fetch the last row in the result set. Valid only for scrollable cursors.
Take the result set of the last row
Fetch_ori_abs
Fetch the requested row by row number from the result set. Valid only for scrollable cursors.
Gets the number of rows requested from the result set
Fetch_ori_rel
Fetch the requested row by relative position from the current position of the cursor in the result set. Valid only for scrollable cursors.
Gets the setting of the requested row from the relative position of the cursor's current position in the result