i have big problem while connection to a remote informix database server.
here's the code
$db = new PDO("informix:host=192.168.*.*; service=1565;
database=daten; server=name; protocol=onsoctcp;
EnableScrollableCursors=1", "informix", "info00");
print "Connection Established!\n\n";
echo "Table contents: $rows.\n";
I receive the following error:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE=HY000, SQLDriverConnect: -917 [Informix][Informix ODBC Driver][Informix]Must close current database before using a new database.' in /var/www/informix.php:9 Stack trace: #0 /var/www/informix.php(9): PDO->__construct('informix:host=1...', 'informix', 'info00') #1 {main} thrown in /var/www/informix.php on line 9
How can I fix this?
DATABASE xyz
statements, not to theCONNECT TO 'dbase'
notation that should be being used by the PDO driver. Your application should not be connecting as 'informix'; that's tantamount to running as 'root' on a Unix box. Dangerous; powerful but dangerous. Please don't do it. - Jonathan LefflerDATABASE xyz
vsCONNECT TO 'dbase'
show my ESQL/C bias; PDO_Informix uses ODBC, of course. Did you connect to anything before? Presumably not. Are you able to connect to a local database successfully (so it is only remote connections that cause trouble)? - Jonathan Leffler