0
votes

The information i have concerning the oracle database i need to connect to using php through easyphp is the following: user, password, host, port, service . New to the odbc thing i tried to use the function odbc_connect but i keep getting errors simply because i don't know how to make a dsn.

Though, i tried using this :

$dns_db="DRIVER={DataDirect 32-BIT SequeLink 5.4};HOST=localhost; PORT=2399;ServerDataSource=maDB;"

But i totally ignore what does {DataDirect 32-BIT SequeLink 5.4} mean, and it seems like i need to know the database's name so i can put it in the ServerDataSource.

So that's my question, can anyone show me how to make this dsn thing ? Thanks in advance.

1
Answering the question would be way helpful than negatively rating it! it happens that we can ignore things especially if we only need them for while ... Thank you anywayMarGa
The exact nature of the DSN is going to vary from system to system, driver to driver, case by case. Please ask your Oracle DBA for assistance constructing it properly. If you don't have a DBA... well ... may whatever gods you believe in have mercy upon your soul.Charles

1 Answers

2
votes

That should be the driver name as it shows up in the ODBC manager. In my computer I have Microsoft ODBC for Oracle and Oracle in instantclient_11_2 to choose from:

enter image description here

Try to use a driver provided by Oracle; the Microsoft one lacks many basic features.

But I'd recommend you to create a system ODBC so you can assign a name of your choice and simply refer to it by such name. Additionally, that allows to configure additional options with the driver's GUI:

enter image description here

Last but not least, my final advice is to dump ODBC completely and use the OCI extension. Coding a PHP app with ODBC is frustrating.