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

(singke) #1

for($i = 0; $i ora_numcols($Cursor); $i++)
{
print("");


// get column info
print(ora_columnname($Cursor, $i). ": ");
print(ora_columntype($Cursor, $i). " ");
print("(". ora_columnsize($Cursor, $i). ")");


print("\n");
}


print("\n");


// get each row
while(ora_fetch($Cursor))
{
print("\n");


//loop over each column
for($i = 0; $i ora_numcols($Cursor); $i++)
{
print("");


// get column
print(ora_getcolumn($Cursor, $i));


print("\n");
}


print("\n");
}


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


print("
\n");
print("Rows: ". ora_numrows($Cursor));
print("
\n");


// Close the Oracle cursor
ora_close($Cursor);


// disconnect.
ora_logoff($Connection);
?>


boolean ora_fetch(integer cursor)


The ora_fetch function causes a row from an executed query to be fetched into the
cursor. This allows you to call ora_getcolumn. See ora_exec for an example of use.

Free download pdf