Menu

#83 Error: CCI, -13, Column index is out of range when calling cubrid_fetch_field()

open
nobody
None
5
2012-02-11
2012-02-11
Jira Trac
No

I have the following table:

{code}
CREATE TABLE tbl_users(
id integer AUTO_INCREMENT,
email character varying(100) NOT NULL UNIQUE,
join_date integer NOT NULL,
CONSTRAINT pk_tbl_users_id PRIMARY KEY(id)
);
{code}

When calling [cubrid_fetch_field()|http://www.php.net/manual/en/function.cubrid-fetch-field.php] in:

{code}
Line 82:
while ($field = cubrid_fetch_field($this-result_id))
{
preg_match('/([a-zA-Z]+)(\((\d+)\))?/', $field-type, $matches);

$length = isset($matches[2]) ? (int)$matches[3] : false;

$F = new stdClass();
$F-name = $field-name;
$F-type = $matches[1];
$F-default = $field-def;
$F-max_length = $length ? $length : $field-max_length;
$F-primary_key = $field-primary_key;

$retval[] = $F;
}
{code}

I receive the following error:

{code}
A PHP Error was encountered

Severity: Warning

Message: Error: CCI, -13, Column index is out of range

Filename: cubrid/cubrid_result.php

Line Number: 82
{code}

According to [cubrid_fetch_field()|http://www.php.net/manual/en/function.cubrid-fetch-field.php] manual, if no more field is found, it should return *FALSE*. Is it a bug?

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.