errors are :
OCI8 DEBUG: OCINlsEnvironmentVariableGet at 
(/home/oracle/oci8/oci8-1.3.4/oci8.c:1819)
 OCI8 DEBUG L1: Got NO cached connection at 
(/home/oracle/oci8/oci8-1.3.4/oci8.c:1864)
 OCI8 DEBUG: OCIEnvNlsCreate at (/home/oracle/oci8/oci8-1.3.4/oci8.c:2768)
 OCI8 DEBUG L1: create_spool: (0) at (/home/oracle/oci8/oci8-1.3.4/oci8.c:2686) 
Oracle Connect Error (nothing here from the error statement!




<?php // File: anyco.php

require('anyco_ui.inc');

$db = "(LMKIIIGD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = lmkiiiGDN)
    )
  )
)
";
oci_internal_debug(1); // turn on tracing
// Create a database connection
// $conn = oci_connect('hr', 'hr', 'xe');
// $conn = oci_connect('hr', 'hr', 'lmkiiiGDNSID');
// $conn = oci_connect('hr', 'hr', '//localhost:8080/lmkiiiGDNSID');
// $conn = oci_connect('hr', 'hr', '//localhost/lmkiiiGDNSID');
// $conn = oci_connect("hr", "hr", "//dwlin165.us.oracle.com/lmkiiiGDNSID");
// $conn = oci_connect('hr', 'hr',$db);

if ($conn=oci_connect('hr', 'hr', $db)) {
echo "Successfully connected to Oracle.\n";
// OCILogoff($conn);
} else {
$err = OCIError();
echo "Oracle Connect Error " . $err['message'];
}

ui_print_header('Departments');
do_query($conn, 'SELECT * FROM DEPARTMENTS');
ui_print_footer(date('Y-m-d H:i:s'));

// Execute query and display results
function do_query($conn, $query)
{
  $stid = oci_parse($conn, $query);
  $r = oci_execute($stid, OCI_DEFAULT);

  print '<table border="1">';
  while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
    print '<tr>';
    foreach ($row as $item) {
      print '<td>'.
            ($item ? htmlentities($item) : '&nbsp;').'</td>';
    }
    print '</tr>';
  }
  print '</table>';
}

?>



      


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to