Check data1.tsl.state.tx.us it I can't even ping it.. try using IP adress
instead or check that name.

----- Original Message -----
From: "toni baker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 25, 2001 4:56 PM
Subject: [PHP] php/Oracle db connection


> I have successfully compiled php with linked iODBC
> driver manager as an Apache shared module.  However
> when trying to connect php to the Oracle database I
> get an error.  The error and the sample connection
> code is below.
>
> Warning: SQL error: [OpenLink][ODBC]RPC: Unknown host,
> SQL state 08004 in SQLConnect in
> /home/httpd/html/ronsdev/putenv.php on line 9
> can not connect to DSN: data1.tsl.state.tx.us
>
> <?
> putenv("LD_LIBRARY_PATH=/usr/local/src/odbcsdk/lib");
> putenv("ODBCINSTINI=/usr/local/src/bin/odbcinst.ini");
> putenv("ODBCINI=/usr/local/src/bin/odbc.ini");
> $dsn="data1.tsl.state.tx.us";
> $user="scott";
> $password="tiger";
> $sql="SELECT * FROM scott.emp";
> if($conn_id=odbc_connect("$dsn","","")) {
>   echo "connected to DSN: $dsn";
> if($result=odbc_do($conn_id, $sql)) {
>   echo "executing '$sql'";
>   echo "Results: ";
>   odbc_result_all($result);
>   echo "freeing result";
>   odbc_free_result($result);
> }
> else {
>   echo "can not execute '$sql'";
> }
>   echo "closing connection $conn_id";
>   odbc_close($conn_id);
> }
> else {
>   echo "can not connect to DSN: $dsn";
> }
> ?>
>
> Can someone help with this?
> Thanks Toni
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to