Re: PHP 4.0 Bug #6033 Updated: Can't open more than one non-persistent connections to the same database
| From: | Manuel Lemos | Date: | Sat, 12 Aug 2000 05:29:34 +0000 |
| Subject: | Re: PHP 4.0 Bug #6033 Updated: Can't open more than one non-persistent connections to the same database | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-28669@lists.php.net to get a copy of this message | ||
Hello Danny,
On 12-Aug-00 01:52:01, you wrote:
>ID: 6033
>Updated by: danny
>Reported By: mlemos@acm.org
>Status: Closed
>Bug Type: Informix related
>Assigned To: danny
>Comments:
>I think I have fixed it, and PHP3 behaviour is restored : ifx_close() now
>really closes the connection. ifx_connect() still recycles the existing
>Zend resource but will silently reconnect behind the scenes if needed.
>Multiple calls to ifx_connect() for the same link without ifx_close()
>reuse the existing connection as before.
>Please test & let me know if this solves your problem.
No, the problem seems to remain in PHP 4. It seems to work in PHP 3. Try
this test script:
<?
Function Doit($database_name,$some_table)
{
global $informix_server,$user,$password;
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("SELECT * FROM $some_table",$connection)))
{
echo "Table: $some_table, Result: $result\n";
ifx_free_result($result);
}
else
echo "Database: $database_name 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";
}
$informix_server="demo_on";
$user="someuser";
$password="somepassword";
DoIt("sysmaster","informix.arc_ae_view");
$user="anotheruser";
$password="anotherpassword";
DoIt("sysutils","informix.bar_action");
?>
Regards,
Manuel Lemos
Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org
--
E-mail: mlemos@acm.org
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--