Table 13.10. Constants for Use with ocifetchinto
Constant Description
OCI_ASSOC (^) Return columns indexed by name
OCI_NUM (^) Return columns indexed by number
OCI_RETURN_NULLS (^) Create elements for null columns
OCI_RETURN_LOBS (^) Return values of LOBs instead of descriptors
<?
//connect to database
$Connection = ocilogon("scott", "tiger");
//assemble query
$Query = "SELECT * ";
$Query .= "FROM emp ";
//parse query
$Statement = ociparse($Connection, $Query);
//execute query
ociexecute($Statement);
//check that the query executed sucessfully
if($Error = ocierror($Statement))
{
print($Error["code"]. ": ". $Error["message"].
"
\n");
exit;
}
//start HTML table
print("
SMITH | "$value | \n");
//free the statement
ocifreestatement($Statement);