This is what I have done so far............
In order to connect my website to an informix database, I installed Informix client SDK and entered server and host information through Setnet32 and the connection was working when tested through ConnectTest Demo .
Then through ODBC Data Source Administrator in windows I created User DSN and System DSN and tested the connection too.
Now I have created a connection string that goes like this:
$dbh = new PDO("odbc:Driver={IBM INFORMIX ODBC DRIVER};HOSTNAME=172.56.100.12;PORT=8056;DATABASE=eadmin;PROTOCOL=onsoctcp; UID=prsnl;PWD=prsnl;");
In this case on trying to login ,the error I get is as follows:
PDOException: SQLSTATE[HY000] SQLDriverConnect: -11060 [Informix][Informix ODBC Driver]General error.
I tried another connection string that goes like this :
$dbh = new PDO("Dsn=bnm_info;Driver={IBM INFORMIX ODBC DRIVER};HOSTNAME=172.56.100.12;PORT=8056;DATABASE=eadmin;PROTOCOL=onsoctcp; UID=prsnl;PWD=prsnl;");
In this case the error I get is as follows:
PDOException: invalid data source name
To make things more clear,the code for accessing database is as follows:
$query = "select decrypt_char(passwd,'" . $_POST['passwd'] . "') from edak_users where userid='" . $_SESSION['username'] . "'";
$tt = $dbh->query($query);
$rs=$tt->fetch(PDO::FETCH_NUM);
Please suggest a solution to get me through as this issue is driving me nuts.
Any help is highly welcome. Thanking in anticipation