Can one explain me why I has got a result:
-------------------------------------------------
Warning: mysql_query(): 4 is not a valid MySQL-Link resource in ...
  $result = mysql_query('SELECT 1+1', $db1);
-------------------------------------------------
from next example.

The example does not work correctly (as I expect) in PHP 4.3.8, 4.3.9, 5.0.2
It works OK in PHP 4.3.6 or when line "$db2 = 0;" had been commented
in all described versions of PHP.

If it's a correct behaviour in new versions of PHP so
how can I free/unset $db2 variable without triggering
such effect?

-------------------------------------------------
error_reporting(E_ALL);
$db1 = mysql_connect ('localhost', 'test', '1');
$db2 = mysql_connect ('localhost', 'test', '1');
mysql_close($db2);
$db2 = 0;
$result = mysql_query('SELECT 1+1', $db1);
if ($result)
{
    $row = mysql_fetch_row($result);
    echo "Result: {$row[0]}\n";
}
-------------------------------------------------

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to