Hi
I use the following code snippet using OCI8 functions to retieve details from an Oracle 9 database, but when I run it against an Oracle 7 database I get a Warning: ocifetchstatement(): OCIFetchStatement: ORA-01002: fetch out of sequence message - I seem only to be getting back column names - the columns themselves appear empty.
I know OCI8 functions are supposed to work with Oracle 7.
$conn = OCILogon($user, $password, $db)
or die(var_dump( OCIError()));
$stat = OCIParse($conn, "select * from general_codes")
or die(var_dump( OCIError()));
OCIExecute($stat, OCI_DEFAULT)
or die(var_dump( OCIError()));
//GET THE COLUMN NAMES
$titles = array();
$cols = OCINumCols($stat);
for ($c = 1; $c <= $cols; $c++)
$titles[] = OCIColumnName($stat, $c);
//GET THE COLUMN VALUES
$contents = array();
OCIFetchStatement($stat, $contents);
Any ideas would be greatly appreciated?