ID: 31681 Updated by: php-bugs@lists.php.net Reported By: joesterg at hotmail dot com -Status: Feedback +Status: No Feedback Bug Type: Strings related Operating System: Windows 2000 Server PHP Version: 5.0.3 New Comment:
No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". Previous Comments: ------------------------------------------------------------------------ [2005-01-25 15:06:42] [EMAIL PROTECTED] Please read the comment again: "no external resources" If you can't come up with an isolated test case we can't fix anything. ------------------------------------------------------------------------ [2005-01-24 21:54:27] joesterg at hotmail dot com Ok, I can provide that, but you also need a setup with a SQL Server 2000 to replicate this fully... ------------------------------------------------------------------------ [2005-01-24 21:50:41] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2005-01-24 21:42:30] joesterg at hotmail dot com Description: ------------ Whenever trim(...) is used on the $value=trim($colstr->value); line, the loop stops. However, splitting the line in two: $value=$colstr->value; $value=trim($value); makes the loop work as expected... Reproduce code: --------------- $this->DBResult=$this->DBCon->Execute($sqlQuery); $num_columns = $this->DBResult->Fields->Count(); $this->DBResultSet=null; for($i=0; $i < $num_columns; $i++) { $colstr=$this->DBResult->Fields($i); $name=$colstr->Name; toLog("DB_ADO.query","3.0: i=".$i.", Fields=".$colstr."/".$name.", num_columns=".$num_columns); $value=trim($colstr->value); toLog("DB_ADO.query","3.1: i=".$i.", Fields=".$colstr."/".$name."/".$value.", num_columns=".$num_columns); $this->DBResultSet[$rowcount][$name]=$value; toLog("DB_ADO.query","3.2: this->DBResultSet[rowcount][name]=".$this->DBResultSet[$rowcount][$name]); } Expected result: ---------------- DBCon is an ADO connection to SQL Server 2000. I expect to have the code loop through the columns found in the query, assigning each column a value in the DBResultSet array. Seeing the following in the log: 2005.01.24-21.43:02***DB_ADO.query***1: select statement 2005.01.24-21.43:02***DB_ADO.query***2: num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.0: i=0, Fields=4/id, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.1: i=0, Fields=4/id/4, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.2: this->DBResultSet[rowcount][name]=4 2005.01.24-21.43:02***DB_ADO.query***3.0: i=1, Fields=jqj/username, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.1: i=1, Fields=jqj/username/jqj, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.2: this->DBResultSet[rowcount][name]=jqj 2005.01.24-21.43:02***DB_ADO.query***3.0: i=2, Fields=8ad8757baa8564dc136c1e07507f4a98/password, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.1: i=2, Fields=8ad8757baa8564dc136c1e07507f4a98/password/8ad8757baa8564dc136c1e07507f4a98, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.2: this->DBResultSet[rowcount][name]=8ad8757baa8564dc136c1e07507f4a98 2005.01.24-21.43:02***DB_ADO.query***3.0: i=3, Fields=Jørgen Østergaard/realname, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.1: i=3, Fields=Jørgen Østergaard/realname/Jørgen Østergaard, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.2: this->DBResultSet[rowcount][name]=Jørgen Østergaard 2005.01.24-21.43:02***DB_ADO.query***3.0: i=4, [EMAIL PROTECTED]/email, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.1: i=4, [EMAIL PROTECTED]/email/[EMAIL PROTECTED], num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.2: this->[EMAIL PROTECTED] 2005.01.24-21.43:02***DB_ADO.query***3.0: i=5, Fields=-/phone, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.1: i=5, Fields=-/phone/-, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.2: this->DBResultSet[rowcount][name]=- 2005.01.24-21.43:02***DB_ADO.query***3.0: i=6, Fields=-/fax, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.1: i=6, Fields=-/fax/-, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.2: this->DBResultSet[rowcount][name]=- 2005.01.24-21.43:02***DB_ADO.query***3.0: i=7, Fields=DEA/companycode, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.1: i=7, Fields=DEA/companycode/DEA, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.2: this->DBResultSet[rowcount][name]=DEA 2005.01.24-21.43:02***DB_ADO.query***3.0: i=8, Fields=ADMIN/role, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.1: i=8, Fields=ADMIN/role/ADMIN, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.2: this->DBResultSet[rowcount][name]=ADMIN 2005.01.24-21.43:02***DB_ADO.query***3.0: i=9, Fields=EN/languagecode, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.1: i=9, Fields=EN/languagecode/EN, num_columns=10 2005.01.24-21.43:02***DB_ADO.query***3.2: this->DBResultSet[rowcount][name]=EN Actual result: -------------- >From the log: 2005.01.24-21.41:15***DB_ADO.query***1: select statement 2005.01.24-21.41:15***DB_ADO.query***2: num_columns=10 2005.01.24-21.41:15***DB_ADO.query***3.0: i=0, Fields=4/id, num_columns=10 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31681&edit=1