Exemplo n.º 1
0
 public function fetchRow()
 {
     if (!empty($this->query)) {
         return cubrid_fetch_row($this->query);
     } else {
         return 0;
     }
 }
function cubrid_get_value($query, $link_identifier)
{
    $result = cubrid_execute($link_identifier, $query);
    if ($result) {
        $row = cubrid_fetch_row($result);
        $value = $row[1];
    } else {
        return -1;
    }
    return $value;
}
Exemplo n.º 3
0
 public function testCubridCci6_t10()
 {
     // case : ac on
     // multi_connection tname?
     if (OUTPUT_FUNCTION_NAME == true) {
         echo "\r\nRunning: " . __FUNCTION__ . " = ";
     }
     try {
         $this->sql = "create table t10(code int unique, s string) ";
         cubrid_execute($this->con, $this->sql);
         for ($count = 0; $count < 10; $count++) {
             $this->sql = "delete from t10 ";
             cubrid_execute($this->con, $this->sql);
             cubrid_commit($this->con);
             for ($i = 0; $i < 1000; $i++) {
                 $this->sql = "insert into t10 values({$i}, 'aaa')";
                 $this->req = cubrid_execute($this->con, $this->sql);
             }
             $this->sql = "select count(*) from t10";
             $this->req = cubrid_execute($this->con, $this->sql);
             $str = cubrid_fetch_row($this->req);
             echo $str[0];
             $this->assertEquals($str[0], 1000);
             echo "\r\n-----Running:---------------{$count}  ";
         }
         echo "\r\n#### case Cci6_t10 OK #### ";
     } catch (Exception $e) {
         echo "\r\n#### Catch Cci6_t10 Exception #### ";
     }
     $this->sql = "drop table t10";
     cubrid_execute($this->con, $this->sql);
     cubrid_commit($this->con);
     $this->req = null;
 }
Exemplo n.º 4
0
 public function getCol($sql, $params = array())
 {
     $result = $this->_Execute($sql, $params);
     if (!$result) {
         return array();
     }
     if (cubrid_num_rows($result) < 1) {
         return array();
     }
     $arrDat = array();
     while ($row = cubrid_fetch_row($result)) {
         $arrDat[] = $row[0];
     }
     $this->_smartFreeResult($result);
     return $arrDat;
 }
Exemplo n.º 5
0
function sql_fetch_row($result)
{
    $row = cubrid_fetch_row($result);
    return $row;
}