本文整理汇总了PHP中cubrid_fetch_array函数的典型用法代码示例。如果您正苦于以下问题:PHP cubrid_fetch_array函数的具体用法?PHP cubrid_fetch_array怎么用?PHP cubrid_fetch_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cubrid_fetch_array函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: field_data
function field_data()
{
$retval = array();
$tablePrimaryKeys = array();
while ($field = cubrid_fetch_field($this->result_id)) {
$F = new stdClass();
$F->name = $field->name;
$F->type = $field->type;
$F->default = $field->def;
$F->max_length = $field->max_length;
$res = cubrid_query($this->conn_id, "SELECT COUNT(*) FROM db_index WHERE class_name = '" . $field->table . "' AND is_primary_key = 'YES' AND index_name = 'pk_" . $field->table . "_" . $field->name . "'");
if ($res) {
$row = cubrid_fetch_array($res, CUBRID_NUM);
$F->primary_key = $row[0] > 0 ? 1 : null;
} else {
$F->primary_key = null;
}
if (is_resource($res)) {
cubrid_close_request($res);
$this->result_id = FALSE;
}
$retval[] = $F;
}
return $retval;
}
示例2: field_data
/**
* Field data
*
* Generates an array of objects containing field meta-data
*
* @access public
* @return array
*/
function field_data()
{
$retval = array();
$tablePrimaryKeys = array();
while ($field = cubrid_fetch_field($this->result_id)) {
$F = new stdClass();
$F->name = $field->name;
$F->type = $field->type;
$F->default = $field->def;
$F->max_length = $field->max_length;
// At this moment primary_key property is not returned when
// cubrid_fetch_field is called. The following code will
// provide a patch for it. primary_key property will be added
// in the next release.
// TODO: later version of CUBRID will provide primary_key
// property.
// When PK is defined in CUBRID, an index is automatically
// created in the db_index system table in the form of
// pk_tblname_fieldname. So the following will count how many
// columns are there which satisfy this format.
// The query will search for exact single columns, thus
// compound PK is not supported.
$res = cubrid_query($this->conn_id, "SELECT COUNT(*) FROM db_index WHERE class_name = '" . $field->table . "' AND is_primary_key = 'YES' AND index_name = 'pk_" . $field->table . "_" . $field->name . "'");
if ($res) {
$row = cubrid_fetch_array($res, CUBRID_NUM);
$F->primary_key = $row[0] > 0 ? 1 : null;
} else {
$F->primary_key = null;
}
if (is_resource($res)) {
cubrid_close_request($res);
$this->result_id = FALSE;
}
$retval[] = $F;
}
return $retval;
}
示例3: fetchArray
public function fetchArray()
{
if (!empty($this->query)) {
return cubrid_fetch_array($this->query);
} else {
return false;
}
}
示例4: sql_fetch_array
function sql_fetch_array($result, $result_type = CUBRID_BOTH)
{
$row = cubrid_fetch_array($result, $result_type);
return $row;
}