Skip to content
Troy Davisson edited this page Mar 5, 2016 · 3 revisions

Note: This page documents capabilities available in the older 1.x version. Please see this repository's README file for the new 2.x version documentation.

SearchGetFields

SearchGetFields ( string $pointer_id )

Returns the field names from the referenced SearchQuery() response.

Parameters

$pointer_id - The returned value from SearchQuery()

Return Value

Array

Returns the list of field names from the referenced SearchQuery().

Usage Examples

Unrealistic example but powerful if used creatively

<?php
// make search request
$search = $rets->SearchQuery("Property","RES","(ListDate=1990-01-01+)");
// get the first record returned
$listing = $rets->FetchRow($search);
// get list of fields for our loop
$fields = $rets->SearchGetFields($search);
// loop through each field in the response and pull it's value
foreach ($fields as $field) {
        echo "+ {$field} value is {$listing[$field]}\n";
}
+ AgentID value is 1
+ Baths value is 3
+ Bedrooms value is 4
+ Board value is TestMLS
+ City value is Buffalo Grove
+ CloseDate value is 
+ ClosePrice value is 
+ ContractDate value is 
+ County value is Lake
+ Garage value is 3
+ ListingID value is 1
+ ListDate value is Fri, 30 May 2008 05:00:00 GMT
+ ListPrice value is 380000
+ LivingArea value is 2000
+ ModificationTimestamp value is Wed, 31 Dec 2008 06:00:00 GMT
+ Rooms value is 12
+ SqFt value is 4000
+ State value is IL
+ Status value is Active
+ StreetDirection value is 
+ StreetName value is Fox Hill
+ StreetNumber value is 83
+ Unit value is 
+ YearBuilt value is 1985
+ ZipCode value is 60089
Related To

SearchQuery, FetchRow