PHP 4.0 Bug #7732 Updated: php.exe crashes when you make a query using 'select * from table_name'

From: Date: Sun, 31 Dec 2000 01:00:56 +0000
Subject: PHP 4.0 Bug #7732 Updated: php.exe crashes when you make a query using 'select * from table_name'
Groups: php.dev 
Request: Send a blank email to php-dev+get-42606@lists.php.net to get a copy of this message
ID: 7732 Updated by: sniper Reported By: pedronaranjo@yahoo.com Old-Status: Feedback Status: Closed Old-Bug Type: MSSQL related Bug Type: MySQL related Assigned To: Comments: Try PHP 4.0.4 and if this happens with it too, reopen this bug report. --Jani Previous Comments: --------------------------------------------------------------------------- [2000-11-30 20:42:30] 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-11-09 12:58:35] pedronaranjo@yahoo.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... --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=7732

« previous php.dev (#42606) next »