示例#1
0
 public function fetchAssoc()
 {
     if (!empty($this->query)) {
         return cubrid_fetch_assoc($this->query);
     } else {
         return false;
     }
 }
示例#2
0
 /**
  * Result - associative array
  *
  * Returns the result set as an array
  *
  * @access private
  * @return array
  */
 function _fetch_assoc()
 {
     return cubrid_fetch_assoc($this->result_id);
 }
function cubrid_mysql_fetch_assoc($result)
{
    return cubrid_fetch_assoc($result);
}
示例#4
0
 /**
  * Get multiple records
  *
  * @param string $query The sql query
  * @param string $type return data type option. the default is "object"
  */
 public function results($query, $returnType = false)
 {
     $return = false;
     if ($returnType) {
         $this->returnType = $returnType;
     }
     if (is_null($query)) {
         $query = $this->command();
     }
     $result = $this->query($query);
     if ($this->returnType == 'object') {
         while ($row = cubrid_fetch_object($result, $this->instantiateClass)) {
             $return[] = $row;
         }
         cubrid_close_request($result);
         return $return;
     }
     if ($this->returnType == 'iterator') {
         return $result;
     }
     if ($this->returnType == 'array') {
         while ($row = cubrid_fetch_assoc($result)) {
             $return[] = $row;
         }
         cubrid_close_request($result);
         return $return;
     }
     return $return;
 }
示例#5
0
 public function getRow($sql, $params = array())
 {
     $result = $this->_execute($sql, $params);
     if (!$result) {
         return null;
     }
     if (cubrid_num_rows($result) < 1) {
         return null;
     }
     $arrDat = cubrid_fetch_assoc($result);
     /*
     // adodb.sf.net의 lib를 사용하면서 필드가 모두 소문자로 왔던 것 때문에
     // 하위 호환성을 위한 코드
     $tmpRow = array();
     
     foreach ($arrDat as $k=>$v)
     	$tmpRow[strtolower($k)] = $v;
     
     $arrDat = $tmpRow;
     unset($tmpRow);
     */
     $this->_smartFreeResult($result);
     return $arrDat;
 }
示例#6
0
 /**
  * @group arnia-wrong-parameters
  */
 public function testCubridFetchAssoc3()
 {
     if (OUTPUT_FUNCTION_NAME == true) {
         echo "\r\nRunning: " . __FUNCTION__ . " = ";
     }
     try {
         $this->assertTrue($this->createTestTable(), "Failed to create the test table.");
         $this->sql = "SELECT * FROM test_table";
         $this->req = cubrid_execute($this->con, $this->sql);
         $val = cubrid_fetch_assoc(-1);
         $this->assertTrue(FALSE, "Expected Exception not thrown.");
     } catch (Exception $e) {
         //echo $e->getMessage()."\r\n";
         $this->assertEquals(0, cubrid_error_code());
         $this->assertEquals(0, cubrid_error_code_facility());
         $this->assertEquals('', cubrid_error_msg());
     }
     $this->deleteTestTable();
 }
示例#7
0
function sql_fetch_assoc($result)
{
    $row = cubrid_fetch_assoc($result);
    return $row;
}