#30592 [Bgs]: not a valid MySQL-Link resource

From: Date: Thu, 28 Oct 2004 16:36:39 +0000
Subject: #30592 [Bgs]: not a valid MySQL-Link resource
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-68438@lists.php.net to get a copy of this message
ID: 30592 User updated by: v_shiray at ukr dot net Reported By: v_shiray at ukr dot net Status: Bogus Bug Type: MySQL related Operating System: Linux PHP Version: 4.3.9 New Comment: I had read manual many time before submitinig the "bug". So as you said it's a normal behavior but it's very strange as for me. Maybe you will have time to answer on some questions. Why do this behaviour different between versions of PHP, e.g 4.3.6 and 4.3.9 ? How can I unset $db2 without triggering this "problem"? So I may change $db2 = 0; to unset($db2); with the same effect. Previous Comments: ------------------------------------------------------------------------ [2004-10-28 07:22:01] georg@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php See http://www.php.net/mysql_connect ------------------------------------------------------------------------ [2004-10-28 03:01:18] v_shiray at ukr dot net MySQL 4.0.20 Problem has been detected also with PHP 4.3.8 and 5.0.2 on the same computer RedHat 9.0, MySQL 3.23.58, PHP 4.3.9 ------------------------------------------------------------------------ [2004-10-28 01:52:39] v_shiray at ukr dot net Description: ------------ Below code has produced next output: Current connections: Resource id #4, Resource id #4 PHP Warning: mysql_query(): 4 is not a valid MySQL-Link resource in ... Tested on Linux Slackware 10.0 PHP Version => 4.3.9 System => Linux gate 2.4.27-lck3 #3 ðÔÎ á×Ç 13 01:00:30 EEST 2004 i686 Build Date => Sep 30 2004 23:01:51 Configure Command => './configure' '--prefix=/opt/php' '--with-config-file-path=/opt/php/etc' '--disable-cgi' '--enable-static' '--disable-shared' '--enable-sockets' '--enable-ftp' '--with-mysql=/usr' '--with-zlib=/usr' PS. PHP 4.3.6 and 4.3.7 are not affected for this problem. Reproduce code: --------------- error_reporting(E_ALL); $db1 = mysql_connect ('localhost', 'test', '1'); $db2 = mysql_connect ('localhost', 'test', '1'); echo "Current connections: $db1, $db2\n"; mysql_close($db2); $db2 = 0; mysql_query('SELECT 1+1', $db1); Expected result: ---------------- Resource ID must be available with $db1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30592&edit=1

« previous php.bugs (#68438) next »