Which is the equivalent of mysql_data_seek using pdo objects?
Can you give me an example?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The usual answer is: do your data seek directly in the array
PDOStatement::fetchAll… But it is WRONG IF the query fetches a lot of data (!).There are 2 real solutions,
1) if database permits use
PDO::FETCH_ORI_ABSorPDO::FETCH_ORI_REL,example,
(EDIT) But, as commented by @ChoiZ, have a PDO-MySQL limitation: “MySQL does not support cursors” (outside stored programs) “and the driver cannot emulate them for you”… Try later or with MySQL’s forks, like MariaDB.
2) use the database solution (a kind of pagination). Example: