Page 1 of 1

ODBC Connection

Posted: Sun Dec 14, 2003 11:41 pm
by Arulraj
Hello,

Recently I have started PHP. To some extent I could get through.

Instead of sticking to any particular database, I am using the ODBC. I am using the common.php to have connection handle and the same I am including wherever the database connection is required and I am usong ODBC_close_all() at the end of the PHP program.

while I am going back and forwarding the page I am getting the following error

Warning: SQL error: [IBM][CLI Driver] SQL0842N A connection to server " DMA" already exists. SQLSTATE=08002 , SQL state 08002 in SQLConnect in C:\dma\common.php on line 2

and series of warning (this willl be solved when the above issue is sorted out.)

Please give the solution, how to overcome from this problem.

Thanks in advance.

S.Arul

Posted: Mon Dec 15, 2003 3:15 am
by malcolmboston
maybe the connection is trying to start whilst anothers still open? sounds like it to me, is ODBC_close_all() a valid string? possibly deprecated, i have no experience with ODBC drivers so im just having a shot in the dark here

you dont need to open and close a connection like that (i dont anyway <--mysql)

just write out a file, with all your connection info
then on each page

Code: Select all

<?php require_once "connections/myconn.php" ?>
or something to that effect, simple!

thats how i do it anyway