Question

I have been trying to set up an automated script to pull from a RETS server using PHP and I can not get the PHRets search to return anything. My query is below:

/* Search RETS server */
    $search = $rets->SearchQuery(
        'Property',             // Resource
        3,                  // Class
        '(LastTransDate_f77=2013-01-01+)',  // DMQL
        array(
            'Format'    => 'COMPACT-DECODED',
            'Select'    => 'AREA_f16',
            'Count'     => 1,
            'Limit'     => 20,
        )
    );

EDIT: I got this working finally. The problem had nothing to do with my code, however, it was in the MLS board's faulty documentation. The documentation said that I could select certain fields for certain property types, but that wasn't the case. I had to consult a third party developer and get the list of fields/column names that he had used.

No correct solution

OTHER TIPS

Consult the PHRETS documentation. You have the second parameter as an integer. It should be a string. Also the comma needs to be removed after the last element in the array.

/* Search RETS server */
$search = $rets->SearchQuery(
    'Property',           
    '3',               
    '(LastTransDate_f77=2013-01-01+)', 
    array(
    'Format'    => 'COMPACT-DECODED',
    'Select'    => 'AREA_f16',
    'Count'     => 1,
    'Limit'     => 20
    ));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top