Uploaded image for project: 'CUBRID APIs'
  1. CUBRID APIs
  2. APIS-117

[PHP]cubrid_fetch_field will affect the cursor position which will influence the results of cubrid_fetch

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PHP-8.4.1, PHP-Apricot
    • Component/s: PHP Driver
    • Labels:
      None

      Description

      cubrid_fetch_field will will put the cursor position at the end of the result set. This should not be the function of this method. For example:

      {panel}
      <?php

      $conn = cubrid_connect ('localhost', 33000, 'demodb', 'public', '');

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

      $row = cubrid_fetch ($req);

      echo "The first row:\n";
      print_r ($row);

      $field = cubrid_fetch_field ($req);
      print_r ($field);

      $row = cubrid_fetch ($req);

      echo "second row\n";
      print_r ($row);
      ?>
      {panel}

      The output will be:

      {panel}
      The first row:
      Array
      (
      [0] => X
      [s_name] => X
      [1] => Mixed
      [f_name] => Mixed
      )
      stdClass Object
      (
      [name] => s_name
      [table] => code
      [def] =>
      [max_length] => 1
      [not_null] => 0
      [primary_key] => 0
      [unique_key] => 0
      [multiple_key] => 1
      [numeric] => 0
      [blob] => 0
      [type] => char(1)
      [unsigned] => 0
      [zerofill] => 0
      )
      second row{panel}

        Issue Links

          Activity

          Hide
          hellohuizhang 张慧 added a comment -

          Commit rev: 448

          Show
          hellohuizhang 张慧 added a comment - Commit rev: 448

            People

            • Assignee:
              hellohuizhang 张慧
              Reporter:
              hellohuizhang 张慧
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: