Hi,

I don't find that this question was solved.

I want to access via ODBC using a PHP script hosted on a Linux machine to an Oracle 10g server on other machine.

I can access and view the tables with isql ( using ODBC ).

isql -v INSTANCIA uid pwd
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+

I am trying to connect to the database with this PHP code

if( odbc_connect("INSTANCIA", "uid", "pwd") === false ) {
    // Error al conectar..
    exit("Error al conectar con la BBDD.");
}

and the log of httpd shows me this error

[Fri Mar 13 13:28:18 2009] [error] [client 192.168.25.101] PHP Warning:  odbc_connect() [<a href='function.odbc-connect'>function.odbc-connect</a>]: SQL error: [unixODBC][Oracle][ODBC][Ora]ORA-12162: TNS:net service name is incorrectly specified\n, SQL state S1000 in SQLConnect in /var/www/html/index.php on line 25

I do not understand because using the same data I connect with isql and I can't connect using PHP. Am I using the function odbc_connect wrong ?.

Regards

    Write a Reply...