<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.cubrid.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.cubrid-move-cursor.php',
    1 => 'cubrid_move_cursor',
    2 => 'Move the cursor in the result',
  ),
  'up' => 
  array (
    0 => 'ref.cubrid.php',
    1 => 'Функції CUBRID',
  ),
  'prev' => 
  array (
    0 => 'function.cubrid-lock-write.php',
    1 => 'cubrid_lock_write',
  ),
  'next' => 
  array (
    0 => 'function.cubrid-next-result.php',
    1 => 'cubrid_next_result',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/cubrid/functions/cubrid-move-cursor.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.cubrid-move-cursor" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">cubrid_move_cursor</h1>
  <p class="verinfo">(PECL CUBRID &gt;= 8.3.0)</p><p class="refpurpose"><span class="refname">cubrid_move_cursor</span> &mdash; <span class="dc-title">Move the cursor in the result</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.cubrid-move-cursor-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>cubrid_move_cursor</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$req_identifier</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$offset</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$origin</code><span class="initializer"> = CUBRID_CURSOR_CURRENT</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
    The <span class="function"><strong>cubrid_move_cursor()</strong></span> function is used to move the
    current cursor location of <code class="parameter">req_identifier</code> by the
    value set in the <code class="parameter">offset</code> argument, to the direction
    set in the <code class="parameter">origin</code> argument. To set the
    <code class="parameter">origin</code> argument, you can use <strong><code>CUBRID_CURSOR_FIRST</code></strong>
    for the first part of the result, <strong><code>CUBRID_CURSOR_CURRENT</code></strong> for the current
    location of the result, or <strong><code>CUBRID_CURSOR_LAST</code></strong> for the last part of the
    result. If <code class="parameter">origin</code> argument is not explicitly
    designated, then the function uses <strong><code>CUBRID_CURSOR_CURRENT</code></strong> as its default
    value.
  </p>
  <p class="para">
    If the value of cursor movement range goes over the valid limit, then the
    cursor moves to the next location after the valid range for the cursor.
    For example, if you move 20 units in the result with the size of 10, then
    the cursor will move to 11th place and return <strong><code>CUBRID_NO_MORE_DATA</code></strong>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.cubrid-move-cursor-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
  <dl>
    
  <dt><code class="parameter">req_identifier</code></dt>
  <dd><p class="para">Request identifier.</p></dd>
   
   
  <dt><code class="parameter">offset</code></dt>
  <dd><p class="para">Number of units you want to move the cursor.</p></dd>
   
  
  <dt><code class="parameter">origin</code></dt>
  <dd><p class="para">Location where you want to move the cursor from <strong><code>CUBRID_CURSOR_FIRST</code></strong>, <strong><code>CUBRID_CURSOR_CURRENT</code></strong>, <strong><code>CUBRID_CURSOR_LAST</code></strong>.</p></dd>
   
  </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.cubrid-move-cursor-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Повертає <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> у разі успіху або <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> в разі помилки.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.cubrid-move-cursor-examples">
  <h3 class="title">Приклади</h3>
  <div class="example" id="example-1">
   <p><strong>Приклад #1 <span class="function"><strong>cubrid_move_cursor()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$conn </span><span style="color: #007700">= </span><span style="color: #0000BB">cubrid_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"127.0.0.1"</span><span style="color: #007700">, </span><span style="color: #0000BB">33000</span><span style="color: #007700">, </span><span style="color: #DD0000">"demodb"</span><span style="color: #007700">, </span><span style="color: #DD0000">"dba"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$req </span><span style="color: #007700">= </span><span style="color: #0000BB">cubrid_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">, </span><span style="color: #DD0000">"SELECT * FROM code"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">cubrid_move_cursor</span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">, </span><span style="color: #0000BB">CUBRID_CURSOR_LAST</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$result </span><span style="color: #007700">= </span><span style="color: #0000BB">cubrid_fetch_row</span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cubrid_move_cursor</span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">, </span><span style="color: #0000BB">CUBRID_CURSOR_FIRST</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$result </span><span style="color: #007700">= </span><span style="color: #0000BB">cubrid_fetch_row</span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cubrid_move_cursor</span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">, </span><span style="color: #0000BB">CUBRID_CURSOR_CURRENT</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$result </span><span style="color: #007700">= </span><span style="color: #0000BB">cubrid_fetch_row</span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cubrid_close_request</span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">cubrid_disconnect</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

<div class="example-contents"><p>Поданий вище приклад
виведе:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">array(2) {
  [0]=&gt;
  string(1) &quot;G&quot;
  [1]=&gt;
  string(4) &quot;Gold&quot;
}
array(2) {
  [0]=&gt;
  string(1) &quot;X&quot;
  [1]=&gt;
  string(5) &quot;Mixed&quot;
}
array(2) {
  [0]=&gt;
  string(1) &quot;M&quot;
  [1]=&gt;
  string(3) &quot;Man&quot;
}</pre>
</div>
   </div>
  </div>
 </div>


  <div class="refsect1 seealso" id="refsect1-function.cubrid-move-cursor-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
   <li><span class="function"><a href="function.cubrid-execute.php" class="function" rel="rdfs-seeAlso">cubrid_execute()</a> - Execute a prepared SQL statement</span></li>   
   </ul>
  </p>
  </div>

 
</div><?php manual_footer($setup); ?>