\n";
// You can make connection to Oracle Database via
// the local Oracle instance or the name of the entry in tnsnames.ora
// First method make connection via the local Oracle Instance
// Please make sure you've set the environment variables ORACLE_SID
// $conn = OCILogon("scott", "tiger");
// Second method make connection via TWO_TASK (tnsnames.ora)
// viper.exzilla.net much match with your entry in tnsnames.ora
$conn = OCILogon("scott", "tiger","VIPER.EXZILLA.NET");
// if you don't want to edit entry in tnsnames.ora you can use the following way to access to oracle database
// $db = "(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = dec4100.exzilla.net)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = O9DEMO.AU.ORACLE.COM)))";
// $conn = OCILogon("scott", "tiger",$db);
$stmt = OCIParse($conn,"select * from emp");
OCIExecute($stmt);
print "";
print "";
print "| Name | ";
print "Type | ";
print "Length | ";
print "
";
$ncols = OCINumCols($stmt);
for ( $i = 1; $i <= $ncols; $i++ ) {
$column_name = OCIColumnName($stmt,$i);
$column_type = OCIColumnType($stmt,$i);
$column_size = OCIColumnSize($stmt,$i);
print "";
print "| $column_name | ";
print "$column_type | ";
print "$column_size | ";
print "
";
}
print "
\n";
OCIFreeStatement($stmt);
OCILogoff($conn);
print "";
print "