本文整理汇总了PHP中cubrid_fetch_assoc函数的典型用法代码示例。如果您正苦于以下问题:PHP cubrid_fetch_assoc函数的具体用法?PHP cubrid_fetch_assoc怎么用?PHP cubrid_fetch_assoc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cubrid_fetch_assoc函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchAssoc
public function fetchAssoc()
{
if (!empty($this->query)) {
return cubrid_fetch_assoc($this->query);
} else {
return false;
}
}
示例2: _fetch_assoc
/**
* Result - associative array
*
* Returns the result set as an array
*
* @access private
* @return array
*/
function _fetch_assoc()
{
return cubrid_fetch_assoc($this->result_id);
}
示例3: cubrid_mysql_fetch_assoc
function cubrid_mysql_fetch_assoc($result)
{
return cubrid_fetch_assoc($result);
}
示例4: results
/**
* 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: getRow
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: testCubridFetchAssoc3
/**
* @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: sql_fetch_assoc
function sql_fetch_assoc($result)
{
$row = cubrid_fetch_assoc($result);
return $row;
}