"how use mysql_data_seek with pdo?" Code Answer

3

the pdo 'cursor' default is pdo::cursor_fwdonly that means that cursor can't back to zero like it happens with mysql_data_seek to allow cursor back to zero it necessary define use 'scrollable cursor'

example:

$db->prepare($query, array(pdo::attr_cursor => pdo::cursor_scroll));

before use it like this:

$row0 = $result->fetch(pdo::fetch_assoc, pdo::fetch_ori_abs, 0);
By sprocket12 on January 25 2022

Answers related to “how use mysql_data_seek with pdo?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.