ID: 5986
Updated by: mfischer
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Feedback
Bug Type: mSQL related
Operating System: RedHat Linux 6.2
PHP Version: 4.0.1
New Comment:

Can you test if this has changed with the latest RC?

http://www.php.net/~zeev/php-4.1.0RC3.tar.gz

Feedback.

Previous Comments:
------------------------------------------------------------------------

[2000-08-11 04:49:33] [EMAIL PROTECTED]

I believe that the problem is caused by the msql_globals.default_link value being set 
to an mSQL database link that has been closed by _close_msql_link in php_msql.c.  
Ideally, when a database link is closed, if it's the default link, then reset the 
default link to -1.  I'm not sure how to do that in the code.  I can get the script to 
work if I add this line to the _close_msql_link function:

msql_globals.default_link = -1;

However, I'm sure this is a less than adequate method, since we don't want to reset it 
all the time.


------------------------------------------------------------------------

[2000-08-10 04:25:01] [EMAIL PROTECTED]

I get the same errors after patching php_msql.c and re-running the script I provided.

------------------------------------------------------------------------

[2000-08-10 02:02:24] [EMAIL PROTECTED]

fixed in CVS (patch by [EMAIL PROTECTED])


------------------------------------------------------------------------

[2000-08-05 19:04:54] [EMAIL PROTECTED]

The following script causes unexpected errors:

Function test ()
{
  $conn1 = msql_connect();
  msql_select_db("nsbo", $conn1);
  
  $Res = msql_query("SELECT * FROM State", $conn1);
  echo msql_NumRows($Res)." rows in State<br>";
  
  msql_close($conn1);
}

test();

$Res = msql("nsbo", "SELECT * FROM Member");
echo msql_NumRows($Res)." rows in Member<br>";  
$Res = msql("library", "SELECT * FROM Publication");
echo msql_NumRows($Res)." rows in Publication<br>";  

The output from PHP is this:

60 rows in State
713 rows in Member

Warning: 1 is not a valid mSQL-Link resource in /disk2/websites/NSBO/test/test_db.html 
on line 18

Warning: Supplied argument is not a valid mSQL result resource in 
/disk2/websites/NSBO/test/test_db.html on line 19
rows in Publication

I am using mSQL 2.0.11, PHP 4.0.1, and Apache 3.0.12.  My PHP configuration is:

./configure --with-apxs=/usr/sbin/apxs --with-gettext=no --with-msql --with-pgsql 
--without-mysql --enable-track-vars=yes --with-pdflib=/usr/local --with-zlib 
--with-jpeg-dir=/usr --with-tiff-dir=/usr --with-session=/tmp --enable-trans-sid



------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=5986&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to