note 8588 deleted from function.mssql-fetch-array by jimw

From: Date: Sat, 08 Dec 2001 19:46:44 +0000
Subject: note 8588 deleted from function.mssql-fetch-array by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-22116@lists.php.net to get a copy of this message
When using PHP(4) on a NT box connecting to MS-SQL, and if you do the following: // assume we have a connection already... $sQuery = "SELECT Keyword FROM KeywordTable"; $iQueryResult = mssql_query($sQuery); $oTestArray = array(); while ($oThisRow = mssql_fetch_array($iQueryResult)) { $oTestArray[] = $oThisRow["Keyword"]; } $iCount = count($oTestArray); for ($i=0; $i<$iCount; $i++) { echo ($oTestArray[$i] . "<br>\n"); } Then you get some VERY weird output! It seems that problem with the returned array from mssql_fetch_array. You MUST do this in order to get correct string value in $oTestArray: $oTestArray[] = strval($oThisRow["Keyword"]); I think this is a bug, since the fetch_array works as the way it should under MySQL.

« previous php.notes (#22116) next »