FAQ
Hello Everyone,

I have a small problem with the mssql extension and resources (Tested with
PHP 5.2).

If I use the same variable to store the resource for a result the second
result is not always correct!

// Example 1 does not work
$rs = mssql_query("select 1");
$rs = mssql_query("select 3 select 2 select 1");

// Example 2 works fine
$rs1 = mssql_query("select 1");
$rs2 = mssql_query("select 3 select 2 select 1");

// Example 3 works fine
$rs = mssql_query("select 1");
mssql_free_result($rs);
$rs = mssql_query("select 3 select 2 select 1");

// Example 4 works fine
$rs = mssql_query("select 1");
unset($rs);
$rs = mssql_query("select 3 select 2 select 1");

The registered destructor is called in all four situations.

So why is there a difference between asigning a new resource value to a
variable with and without the unset()?

- Frank

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedSep 29, '06 at 5:46p
activeSep 29, '06 at 5:46p
posts1
users1
websitephp.net

1 user in discussion

Frank M. Kromann: 1 post

People

Translate

site design / logo © 2022 Grokbase