note 40189 added to function.mssql-fetch-array
| From: | DerekEthier at rn2 dot php dot net | Date: | Tue, 24 Feb 2004 20:06:17 +0000 |
| Subject: | note 40189 added to function.mssql-fetch-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65664@lists.php.net to get a copy of this message | ||
The array_walk function is also useful for stripping the whitespace returned in an mssql_query.
function modify_field(&$array) {
$array = trim($array);
}
$query = "select * from dbo.table where value = '0'";
$result = mssql_query($query) or die;
while ($row = mssql_fetch_array($result)) {
// This will call the above function.
array_walk($row, 'modify_field');
array_push($eventresults, $row);
}
An added benefit is that you can expand the modify_field function to handled unexpected returned
column data.
----
Manual Page -- http://www.php.net/manual/en/function.mssql-fetch-array.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40189
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40189&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40189&report=yes
Search -- http://master.php.net/manage/user-notes.php