php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7239 mssql
Submitted: 2000-10-16 09:07 UTC Modified: 2001-02-20 07:39 UTC
From: siim at depo dot ee Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0.3pl1 OS: Linux 2.2.14
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: siim at depo dot ee
New email:
PHP Version: OS:

 

 [2000-10-16 09:07 UTC] siim at depo dot ee
<?

if(!($c1 = mssql_connect("server","user","password"))) print "bla1";
if(!mssql_select_db("database",$c1)) print "bla2";
$s1 = "select vpID from vp";

if(!($c2 = mssql_connect("server","user","password"))) print "bla12";
if(!mssql_select_db("database",$c2)) print "bla2";
$s2 = "select nimi_et from vp";

if(!$r1 = mssql_query($s1,$c1)) print "bla3";

if(!$r2 = mssql_query($s2,$c2)) print "bla4";

while($d1 = mssql_fetch_row($r1)) {
$d2 = mssql_fetch_row($r2);

print "<br>".$d1[0]." ".$d2[0];

}
mssql_close($c2);

mssql_close($c1);  // <---line 24

?>
<------------- end of script --------------->
result: 
 Segmentation fault
or 
 Correct output + warning "
Warning: 1 is not a Sybase link index in /home/httpd/html/t.php on line 24"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-07 19:18 UTC] sniper@php.net
Does this happen with latest snapshot from http://snaps.php.net/ ??
And if it does, please include a GDB backtrace into this bug report.
Remeber to configure with --enable-debug first!
Also, include the whole configure line you have used into this bug report.

--Jani
 [2001-02-20 07:39 UTC] sniper@php.net
No feedback, considered fixed.

--Jani

 [2003-03-20 04:18 UTC] amorgaut at tf1 dot fr
here is what my code look like :
<?

$connection = mssql_connect("server","login","password"); 
if (!$connection) require("failed.phtml");
else mssql_select_db("database");
if (!$failed) {
  $query = "SELECT * FROM abonnes";
  $result = mssql_query($query,$connection); <--- line 6
  if ($result){
    while ($row = mssql_fetch_row($result)) {
      echo $row[0]." ".$row[1]."<br>\n";
    }
    mssql_free_result($result);
  }
  mssql_close($connection);
}

?>

this usualy work well but here what my error log regulary send me :
--
[31-Jan-2003 14:37:46] PHP Warning:  1 is not a Sybase link index in (...).phtml on line 6
--

I Found that on an other webserver with IIS the function mssql_connect() didn't send me "1" but "Resource id #2"

It looks like that the problem comes from the fact that the function mssql_query() wanted this kind of connexion Id... but why can't I get it from the mssql_connect() function in the same script ???

note that our website works on three server declared with this configuration
--
Linux 2.2.19 - 20
apache 1.3.27
php 4.2.3
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 21 11:01:28 2024 UTC