Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-10265

PDOStatement::rowCount returns 0

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.6
    • None
    • odbc
    • None
    • CentOS, unixODBC

    • Docs Required

    Description

      How to reproduce:

      $ cat ~/odbc.php
      <?php
       
      try {
          echo PHP_EOL,PHP_EOL,"# Using PDO",PHP_EOL;
          $dbh = new PDO('odbc:DRIVER={ApacheIgnite};Server=127.0.0.1;PORT=10800');
          $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
       
          $sql = 'SELECT * FROM "Person".Person';
          $statement = $dbh->prepare($sql);
          $statement->execute();
       
          $data = $statement->fetchAll();
       
          foreach($data as $row) {
              var_dump($row);
          }
       
          echo "array Count : " . count($data) . "\n";
          echo "rowCount : " . $statement->rowCount() . "\n";
       
      } catch (PDOException $e) {
          print "Error!: " . $e->getMessage() . "\n";
          die();
      }
       
      $ php ~/odbc.php
       
      # Using PDO
      array(10) {
        ["ORGID"]=>
        string(1) "1"
        [0]=>
        string(1) "1"
        ["FIRSTNAME"]=>
        string(4) "John"
        [1]=>
        string(4) "John"
        ["LASTNAME"]=>
        string(3) "Doe"
        [2]=>
        string(3) "Doe"
        ["RESUME"]=>
        string(14) "Master Degree."
        [3]=>
        string(14) "Master Degree."
        ["SALARY"]=>
        string(4) "2200"
        [4]=>
        string(4) "2200"
      }
      ・
      ・
      ・
      array(10) {
        ["ORGID"]=>
        string(1) "2"
        [0]=>
        string(1) "2"
        ["FIRSTNAME"]=>
        string(4) "Mary"
        [1]=>
        string(4) "Mary"
        ["LASTNAME"]=>
        string(5) "Major"
        [2]=>
        string(5) "Major"
        ["RESUME"]=>
        string(16) "Bachelor Degree."
        [3]=>
        string(16) "Bachelor Degree."
        ["SALARY"]=>
        string(4) "1200"
        [4]=>
        string(4) "1200"
      }
      array Count : 6
      rowCount : 0
      

      Attachments

        Activity

          People

            isapego Igor Sapego
            shroman Roman Shtykh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: