php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7732 php.exe crashes when you make a query using 'select * from table_name'
Submitted: 2000-11-09 12:58 UTC Modified: 2000-12-30 20:00 UTC
From: pedronaranjo at yahoo dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0.3pl1 OS: NT 4 ws SP5
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: pedronaranjo at yahoo dot com
New email:
PHP Version: OS:

 

 [2000-11-09 12:58 UTC] pedronaranjo at yahoo dot com
Hi there...

   Here is the problem... using the dll extention for MS SQL Server 7 and using the code below:
---------------Code----------------
unction MySql_DB_Select($server, $user, $pass, $db, $sql,$before ,$layout, $after)
{

 //open a connection
 $connection = mysql_connect($server, $user, $pass);

 //built the query
 //$query = "select linkname, link from links";

 //run the query and get the results
 $result = mysql_db_query($db, $sql, $connection);
 $buffer = "";

while ($myrow = mysql_fetch_array($result))
     {
      $fieldcount = mysql_num_fields($result);

      for ($i=0; $i<$fieldcount; $i++)
      {
       $fieldnames[$i] = mysql_fieldname($result, $i);
      }
      //replace the layout with values
      $tmp = $layout;
      foreach($fieldnames as $fieldname)
       {
        //print "$fieldname - $myrow[$fieldname]<br>";
        $tmp = str_replace("<!--<<" . $fieldname . ">>-->", $myrow[$fieldname], $tmp);
       }
      $buffer = $buffer . $tmp;
     }
return "-->" . $before .  $buffer . $after . "<!--";

mysql_free_result($result);
}
---------------Code----------------
PHP.exe crashes with the following error:
---------------Error---------------
Window Title: OleMainThreadWndName: php.exe
Window Message: The instruction at "0x7800d60" refrence memory at "0x0000004". The memory could not be written.
---------------Error---------------
The crash happend when I pass the following value to the var $sql
Example:
$sql = "select * from customer"
Now... if I pass this value
Exmaple:
$sql = "select name from customer"
It works with no problem...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-30 20:42 UTC] fmk@php.net
You have posted this in the MS SQL section but your sample code uses MySQL. Is this a MSSQL or MySQL problem ?
 [2000-12-30 20:00 UTC] sniper@php.net
Try PHP 4.0.4 and if this happens with it too, reopen this bug report.

--Jani
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sun Jun 28 17:00:01 2026 UTC