Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

print("");


//print a line like "ENAME VARCHAR2(10)"
print(ocicolumnname($Statement, $i). " ");
print(ocicolumntype($Statement, $i));
print("(". ocicolumnsize($Statement, $i). ")");


print("\n");
}
print("\n");


//fetch each row
while(ocifetch($Statement))
{
print("\n");


//loop over each column
for($i=1; $i = ocinumcols($Statement); $i++)
{
//print a line like "SMITH/TD>"
print("");
if(ocicolumnisnull($Statement, $i))
{
print("(null)");
}
else
{
print(ociresult($Statement, $i));
}
print("\n");
}


print("\n");
}


//close table
print("\n");


//free the statement
ocifreestatement($Statement);


//close connection
ocilogoff($Connection);
?>


boolean ocifetchinto(integer statement, reference data, integer
mode)


Use ocifetchinto to get the next row of data from an executed statement and place it in
an array. The data argument will contain an array that by default will be indexed by
integers starting with 1. The optional mode argument controls how the array is indexed.
You may add the constants listed in Table 13.10 to get the features you desire.

Free download pdf