Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 | 



cubrid_data_seek

Description

The cubrid_data_seek function moves the internal row pointer of the CUBRID result associated with the specified result identifier to point to the specified row_number. The next call to a CUBRID fetch function, such as cubrid_fetch_assoc(), would return that row.

Syntax

bool cubrid_data_seek (resource $req_identifier, int $row_number)

  • req_identifier : Result identifier
  • row_number : The desired row number of the new result pointer
Return Value
  • Success : TRUE
  • Failure : FALSE
Example

<?php

$conn = cubrid_connect("127.0.0.1", 33000, "demodb");

 

$req = cubrid_execute($conn, "SELECT * FROM code");

cubrid_data_seek($req, 0);

 

$result = cubrid_fetch_row($req);

var_dump($result);

 

cubrid_data_seek($req, 2);

$result = cubrid_fetch_row($req);

var_dump($result);

 

cubrid_data_seek($req, 4);

$result = cubrid_fetch_row($req);

var_dump($result);

 

cubrid_close_request($req);

cubrid_disconnect($conn);

?>

 

The above example will output:

 

array(2) {

  [0]=>

  string(1) "X"

  [1]=>

  string(5) "Mixed"

}

array(2) {

  [0]=>

  string(1) "M"

  [1]=>

  string(3) "Man"

}

array(2) {

  [0]=>

  string(1) "S"

  [1]=>

  string(6) "Silver"

}