ID: 14664
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Informix related
Operating System: Linux 2.2.x
PHP Version: 4.1.0
New Comment:
I found how to correct this :
in the file /ext/informix/ifc.ec
in the function PHP_FUNCTION(ifx_query)
you have to insert the line
EXEC SQL set connection :ifx;
just before the line
PHP_IFX_CHECK_CONNECTION(ifx);
(in the PHP 4.1.1 release, it corresponds to the line 777)
Can someone add this to the official sources ?
(i am not part of the php developers team)
Previous Comments:
------------------------------------------------------------------------
[2001-12-22 20:10:08] [EMAIL PROTECTED]
As demonstrated by the following example if the first (real) query
(besides DATABASE query) fails, any subsequent calls to ifx_query fail
with the same error, suggesting that something from first query failure
state is incorrectly affecting the execution of any following query.
<?php
$informix_server="demo_on";
$database_name="test";
$user="testuser";
$password="testpassword";
PutEnv("INFORMIXSERVER=$informix_server");
if(($connection=ifx_connect("@".$informix_server,$user,$password)))
{
if(($result=@ifx_query("DATABASE $database_name",$connection)))
{
echo "Database: $database_name, Result: $result\n";
ifx_free_result($result);
if(($result=ifx_query("DROP TABLE test",$connection)))
ifx_free_result($result);
else
{
$first_query_error=ifx_errormsg();
if(($result=ifx_query("CREATE TABLE
test",$connection)))
ifx_free_result($result);
else
echo "First query error:
$first_query_error\nSecond query error:
".ifx_errormsg(),"\n";
}
}
else
echo "Database: $database_name Query error:
".ifx_errormsg(),"\n";
ifx_Close($connection);
}
else
echo "Connection error: ".ifx_errormsg(),"\n";
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=14664&edit=1