1

I am talking with a MLS server and I'm pretty sure that I am on it. It just won't give me any arrays back. I am logged on successfully I pulled the Array of Listings Here are two that you may need to know. [LIST_10] => Begin Date
[LIST_15] => Status

This worked

if($connect) {
    /* Get table layout */
    $fields = $rets->SearchQuery("Property", "A");

    /* Take the system name / human name and place in an array */
    $table = array();
    foreach($fields as $field) {
        $table[$field['SystemName']] = $field['LongName'];
    }

    /* Display output */
    print_r($table);
    $rets->Disconnect();
}
}

This returns 0 Records Found

if($connect) {

    $sixmonths = date('c', time()-15778800); // get listings updated within last 6 months

    /* Search RETS server */
    $search = $rets->SearchQuery(
        'Property',                             // Resource
        "A",                                        // Class
        '((LIST_10>='.$sixmonths.'+),(LIST_15=ACT))',   // DMQL, with SystemNames
        array(
            'Format'    => 'COMPACT-DECODED',
            'Select'    => 'LIST_0,LIST_1,LIST_34,LIST_39,LIST_40,LIST_0,LIST_133',
            'Count'     => 1,//0 no record count, data  1 record count + data  2 record count, no data
            'Limit'     => 20
        )
    );

    /* If search returned results */
    if($rets->TotalRecordsFound() > 0) {
        while($data = $rets->FetchRow($search)) {
            print_r($data);
        }
    }
}

I am using this tutorial: http://dangodesign.net/2013/01/getting-started-with-rets-for-php/ Is there any information that would help more?

4

2 回答 2

1

更改您的 DMQL:

'((LIST_10>='.$sixmonths.'+),(LIST_15=ACT))'

至:

'((LIST_10='.$sixmonths.'+),(LIST_15=ACT))'

您不需要在查询中使用 > 符号,这就是 + 符号的含义。我发现这个站点对 DMQL 查询有很好的介绍:FlexMLS

如果您能够连接 PHPRETS,那么您只需要尝试更改以下查询并尝试处理结果。

您可以将元数据在线粘贴到某个地方吗?

于 2014-02-17T05:04:52.997 回答
0

更改您的 DMQL:

'((LIST_10>='.$sixmonths.'+),(LIST_15=ACT))'

至:

'(LIST_10>={$sixmonths}+),(LIST_15=ACT)'

还要确保字段名称正确,并尝试使用标准名称而不是系统名称。

于 2014-02-14T03:48:59.307 回答