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

[PHP][Manual] Some 'Example' codes about the driver in php.net are somewhat confused

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: PHP 9.1.0.0003
    • Fix Version/s: PHP 9.1.0 0004
    • Component/s: PHP Driver
    • Labels:
    • Environment:
      • OS: Linux 64bit
      • CUBRID Server: CUBRID 9.1 (9.1.0.0212) (64bit release build for linux_gnu) (Mar 14 2013 00:16:33)
      • PHP Version: PHP 5.5.0, PHP 5.4.15
      • CUBRID-PHP: PHP 9.1.0.0003

      Description

      There are a number of "Example" described for the driver's functions in php.net are not accurate

      Current Example

      <?php
      $conn = cubrid_connect("localhost", 33000, "demodb");
      
      $req = cubrid_execute($conn, "SELECT * FROM code", CUBRID_INCLUDE_OID);
      $oid = cubrid_current_oid($req);
      $class_name = cubrid_get_class_name($conn, $oid);
      
      print_r($class_name);
      
      cubrid_disconnect($conn);
      ?>
      
      Output: code
      

      Actual Output:

       
      Warning: Error: DBMS, -494, Semantic: SELECT is not authorized on code.
      

      Reason: since the code table was created by the user dba by default, it returns an error if we connect cubrid with the default user (public)

      Modified Example (suggest)

      <?php
      
      $conn = cubrid_connect("localhost", 33367, "demodb", "dba");
      
      $req = cubrid_execute($conn, "SELECT * FROM code", CUBRID_INCLUDE_OID);
      $oid = cubrid_current_oid($req);
      $class_name = cubrid_get_class_name($conn, $oid);
      
      print_r($class_name);
      
      cubrid_disconnect($conn);
      ?>
      
      Output: code
      
      • Summary: there are also other similar cases about the inaccurate 'Example' codes in php.net docs, such as cubrid_current_oid(),cubrid_num_rows() etc. I suggest to update them in order to avoid undesired misunderstandings to user.

        Activity

        Hide
        cn15800 谢韦华[Bert] added a comment -

        The function which was modified:

        cubrid-bind.xml
        cubrid-col-get.xml
        cubrid-col-size.xml
        cubrid-column-names.xml
        cubrid-column-types.xml
        cubrid-commit.xml
        cubrid-connect.xml
        cubrid-current-oid.xml
        cubrid-get-class-name.xml
        cubrid-lob-close.xml
        cubrid-lob-export.xml
        cubrid-lob-get.xml
        cubrid-lob-send.xml
        cubrid-lock-read.xml
        cubrid-lock-write.xml
        cubrid-move-cursor.xml
        cubrid-next-result.xml
        cubrid-num-cols.xml
        cubrid-num-rows.xml
        cubrid-pconnect.xml
        cubrid-put.xml
        cubrid-rollback.xml
        cubrid-schema.xml
        cubrid-seq-drop.xml
        cubrid-seq-insert.xml
        cubrid-seq-put.xml
        cubrid-set-add.xml
        cubrid-set-db-parameter.xml
        cubrid-set-drop.xml
        cubrid-version.xml

        Show
        cn15800 谢韦华[Bert] added a comment - The function which was modified: cubrid-bind.xml cubrid-col-get.xml cubrid-col-size.xml cubrid-column-names.xml cubrid-column-types.xml cubrid-commit.xml cubrid-connect.xml cubrid-current-oid.xml cubrid-get-class-name.xml cubrid-lob-close.xml cubrid-lob-export.xml cubrid-lob-get.xml cubrid-lob-send.xml cubrid-lock-read.xml cubrid-lock-write.xml cubrid-move-cursor.xml cubrid-next-result.xml cubrid-num-cols.xml cubrid-num-rows.xml cubrid-pconnect.xml cubrid-put.xml cubrid-rollback.xml cubrid-schema.xml cubrid-seq-drop.xml cubrid-seq-insert.xml cubrid-seq-put.xml cubrid-set-add.xml cubrid-set-db-parameter.xml cubrid-set-drop.xml cubrid-version.xml
        Hide
        ryin005 Ray Yin added a comment -

        Currently the document has been updated yet http://www.php.net/manual/en/function.cubrid-get-class-name.php, it may be caused by that doc on php.net is not updated daily.

        We can close this issue if the document is updated.

        Show
        ryin005 Ray Yin added a comment - Currently the document has been updated yet http://www.php.net/manual/en/function.cubrid-get-class-name.php , it may be caused by that doc on php.net is not updated daily. We can close this issue if the document is updated.

          People

          • Assignee:
            cn15800 谢韦华[Bert]
            Reporter:
            ryin005 Ray Yin
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: