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

support Collection Data Types in Pdo driver

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PHP 9.1.0 0004
    • Component/s: PHP Driver
    • Labels:
      None
    • Environment:

      Linux 64bit

      Activity

      Hide
      ryin005 Ray Yin added a comment -

      The case could be passed for following codes

      {code}
      <?php

      $conn_str ="cubrid:dbname=demodb;host=localhost;port=33367";
      $cubrid_pdo = new PDO($conn_str, 'dba', '');

      $req = $cubrid_pdo->exec("DROP TABLE IF EXISTS test_tbl2");
      $req = $cubrid_pdo->exec("CREATE TABLE test_tbl2 (col_1 SET(VARCHAR))");

      $sql_stmt_insert = "INSERT INTO test_tbl2 VALUES ;";
      $stmt = $cubrid_pdo->prepare($sql_stmt_insert);

      $data = array("abc","def","ghi");
      $ret = $stmt->bindParam(1, $data, PDO::PARAM_NULL);
      $ret = $stmt->execute();

      $ret = $stmt->bindParam(1, $data,0,0,"varchar");
      $ret = $stmt->execute();

      ?>{code}

      Test Result: Pass

      Show
      ryin005 Ray Yin added a comment - The case could be passed for following codes {code} <?php $conn_str ="cubrid:dbname=demodb;host=localhost;port=33367"; $cubrid_pdo = new PDO($conn_str, 'dba', ''); $req = $cubrid_pdo->exec("DROP TABLE IF EXISTS test_tbl2"); $req = $cubrid_pdo->exec("CREATE TABLE test_tbl2 (col_1 SET(VARCHAR))"); $sql_stmt_insert = "INSERT INTO test_tbl2 VALUES ;"; $stmt = $cubrid_pdo->prepare($sql_stmt_insert); $data = array("abc","def","ghi"); $ret = $stmt->bindParam(1, $data, PDO::PARAM_NULL); $ret = $stmt->execute(); $ret = $stmt->bindParam(1, $data,0,0,"varchar"); $ret = $stmt->execute(); ?>{code} Test Result: Pass
      Hide
      ryin005 Ray Yin added a comment - - edited

      Notice: we may need to let user know that "we can use bindParam(1, $data,0,0,"char") with fifth parameters and the fifth parameter in CUBRID PHP driver is data type of array's element."

      The issue could be closed

      Show
      ryin005 Ray Yin added a comment - - edited Notice: we may need to let user know that "we can use bindParam(1, $data,0,0,"char") with fifth parameters and the fifth parameter in CUBRID PHP driver is data type of array's element." The issue could be closed
      Hide
      cn15800 谢韦华[Bert] added a comment - - edited

      I have add explanation in this page: http://www.php.net/manual/zh/ref.pdo-cubrid.php

      But we need to wait some time to php upload new doc to it's website.

      Show
      cn15800 谢韦华[Bert] added a comment - - edited I have add explanation in this page: http://www.php.net/manual/zh/ref.pdo-cubrid.php But we need to wait some time to php upload new doc to it's website.
      Hide
      cn15800 谢韦华[Bert] added a comment -

      a problem: http://www.php.net/manual/zh/ref.pdo-cubrid.php

      {code}
      Example #3 example #1:Insert set in CUBRID PDO with default data type.

      <example><title>example #1:Insert set in CUBRID PDO with default data type.</title>
      <programlisting role="php">{code}

      We will modify the title of example, because php will add index to example,as follow:

      {code}
      Example #1 Insert LOBs in CUBRID PDO
      Example #2 Fetch LOBs in CUBRID PDO
      Example #3 Insert set in CUBRID PDO with default data type.
      Example #4 Specify data type when insert set in CUBRID PDO{code}

      Example #1--> This index is add by php,we can't modify

      Show
      cn15800 谢韦华[Bert] added a comment - a problem: http://www.php.net/manual/zh/ref.pdo-cubrid.php {code} Example #3 example #1:Insert set in CUBRID PDO with default data type. <example><title>example #1:Insert set in CUBRID PDO with default data type.</title> <programlisting role="php">{code} We will modify the title of example, because php will add index to example,as follow: {code} Example #1 Insert LOBs in CUBRID PDO Example #2 Fetch LOBs in CUBRID PDO Example #3 Insert set in CUBRID PDO with default data type. Example #4 Specify data type when insert set in CUBRID PDO{code} Example #1--> This index is add by php,we can't modify
      Hide
      cn15800 谢韦华[Bert] added a comment -

      after modify:
      CUBRID Bind Data Types:(The fifth parameter of PDOStatement::bindParam):

      Show
      cn15800 谢韦华[Bert] added a comment - after modify: CUBRID Bind Data Types:(The fifth parameter of PDOStatement::bindParam):

        People

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

          Dates

          • Created:
            Updated:
            Resolved: