Date: 11/30/00
- Next message: fmk <email protected>: "[PHP-DEV] PHP 4.0 Bug #7510 Updated: mssql_fetch_object doesnt work (mssql_fetch_array and mssql_fetch_row are OK)"
- Previous message: svanegmond <email protected>: "[PHP-DEV] PHP 4.0 Bug #8064: split("\.", blah) causes crash"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 7732
Updated by: fmk
Reported By: pedronaranjo <email protected>
Status: Feedback
Bug Type: MSSQL related
Assigned To:
Comments:
You have posted this in the MS SQL section but your sample code uses MySQL. Is this a MSSQL or MySQL problem ?
Previous Comments:
---------------------------------------------------------------------------
[2000-11-09 12:58:35] pedronaranjo <email protected>
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...
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7732
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: fmk <email protected>: "[PHP-DEV] PHP 4.0 Bug #7510 Updated: mssql_fetch_object doesnt work (mssql_fetch_array and mssql_fetch_row are OK)"
- Previous message: svanegmond <email protected>: "[PHP-DEV] PHP 4.0 Bug #8064: split("\.", blah) causes crash"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

