ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:recordset:move

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
v5:reference:recordset:move [2016/01/17 00:57] – ↷ Page moved from v5:reference:move to v5:reference:recordset:move mnewnhamv5:reference:recordset:move [2020/01/02 16:59] (current) – fix obvious typos in the example peterdd
Line 8: Line 8:
 </WRAP> </WRAP>
 ===== Description ===== ===== Description =====
-The function ''move()'' moves the cursor to the n<sup>th</sup> record in a recordset. Offsets are zero-based. If the cursor is successfully moved then the function returns true. If the move is unsuccessful, (-ve offset, passed EOF etc) the function returns false. Note that some databases do not support moving to previous rows (scrolling backwards)+The function ''move()'' moves the cursor to the n<sup>th</sup> record in a recordset. Offsets are zero-based. If the cursor is successfully moved then the function returns true. If the move is unsuccessful, (-ve offset, passed EOF etc) the function returns false. Note that some databases do not support moving to previous rows(scrolling backwards)
 ------------------------------------------- -------------------------------------------
 ===== Usage ===== ===== Usage =====
Line 15: Line 15:
  * Connection to DB2 sample database  * Connection to DB2 sample database
  */  */
-$SQL = "SELECT * FROM act" +$sql = "SELECT * FROM act"; 
-$recordset = $db->execute($SQL);+$recordset = $db->execute($sql);
  
 /* /*
Line 26: Line 26:
  * Retrieve the record as an object  * Retrieve the record as an object
  */  */
-$record = $recordset->fetchObj;+$record = $recordset->fetchObj();
  
 print_r($record); print_r($record);
v5/reference/recordset/move.1452988651.txt.gz · Last modified: 2017/04/21 11:37 (external edit)