oci_connect still not working...I added a debug statement

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) : ' ').'</td>';
}
print '</tr>';
}
print '</table>';
}

?>






--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Fred Silsbee [ Di, 18 November 2008 02:49 ] [ ID #1977508 ]

Re: oci_connect still not working...I added a debug statement

> oci_internal_debug(1); // turn on tracing
> // Create a database connection

> // $conn = oci_connect("hr", "hr", "//dwlin165.us.oracle.com/lmkiiiGDNSID");

That definitely won't work..

> // $conn = oci_connect('hr', 'hr',$db);

try
oci_connect('hr', 'hr', '//localhost/xe');

I assume you unlocked the 'hr' account?

See page 35 of
http://www.oracle.com/technology/tech/php/pdf/underground-ph p-oracle-manual.pdf

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
dmagick [ Di, 18 November 2008 02:55 ] [ ID #1977509 ]
PHP » gmane.comp.php.database » oci_connect still not working...I added a debug statement

Vorheriges Thema: what the php guys need to do
Nächstes Thema: PHP4, mssql_* and SQL Server 2005