Trouble with 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
dysfunct
Forum Newbie
Posts: 2
Joined: Wed Oct 10, 2007 8:34 pm

Trouble with ODBC connection

Post by dysfunct »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


As the subject implies, I'm having some issues with setting up an ODBC connection. I believe I have the connection strings set up correctly but it fails every time. I am using a system DSN on Windows and the DSN works both in testing from the Windows ODBC Data Sources app and in Excel. Here's the php I'm using:

Code: Select all

<?php
$conn=odbc_connect('mydb','un','pw');
if (!$conn)
  {exit("Connection Failed: " . $conn);}
$sql="SELECT * FROM table";
The database is Informix, driver is v 8.31 32 bit. Needless to say, I get "Connection Failed:" when I test it. Any suggestions?


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Post Reply