简体   繁体   English

找到0条记录PHP

[英]0 records found PHP

I am talking with a MLS server and I'm pretty sure that I am on it. 我正在与MLS服务器聊天,我很确定自己在上面。 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_10] =>开始日期
[LIST_15] => Status [LIST_15] =>状态

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 这将返回找到的0条记录

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? 我正在使用此教程: http : //dangodesign.net/2013/01/getting-started-with-rets-for-php/有没有什么信息可以帮助您呢?

Change your DMQL from: 从以下位置更改您的DMQL:

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

To: 至:

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

You don't need a > sign in your query that is what the + sign means. 您不需要在查询中使用>号即+号的含义。 I found this site to have a nice introduction to DMQL queries: FlexMLS 我发现此站点对DMQL查询进行了很好的介绍: FlexMLS

If you are able to connect with PHPRETS then you just need to try and change the following query and try to process the results. 如果您可以使用PHPRETS进行连接,则只需尝试更改以下查询并尝试处理结果即可。

Can you please paste the metadata online somewhere? 您能否将元数据在线粘贴到某个地方?

Change your DMQL from: 从以下位置更改您的DMQL:

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

to: 至:

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

Also make sure the field names are correct and try using Standard Names instead of System Names. 另外,请确保字段名称正确,然后尝试使用“标准名称”而不是“系统名称”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM