ODBC Connection

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Arulraj
Forum Newbie
Posts: 10
Joined: Sun Dec 14, 2003 11:41 pm
Location: India

ODBC Connection

Post 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
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post 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
Post Reply