我使用下面的代码查询CREA DDF / RETS以检索XML格式的列表。当我指定标准XML格式时,我没有没有错误的记录。
如果我没有指定格式,PHRETS默认为Compact-Decoded格式并返回记录。
码
require('phrets.php');
$rets = new phRETS;
$criteria = 'LastUpdated=2012-01-01';
$limit = 10;
$options = array('Limit' => $limit, 'Format' => 'Standard-XML'); # also tried STANDARD-XML - wasn't sure if it was case sensitive
$search = $rets->SearchQuery('Property', 'Property', $criteria, $options);
$total_records = $rets->TotalRecordsFound();
$error_info = $rets->Error();
echo "error (code {$error_info['code']}): {$error_info['text']}\n";
echo $total_records." - total_records\n";
$rets->FreeResult($search);
$rets->Disconnect();
结果
错误(代码):
0 - total_records
答案 0 :(得分:0)
您的Rets搜索查询不正确。
如果您想获得2012-01-01之后更新的房产, 更正了搜索查询:
$criteria = '(LastUpdated=2012-01-01+)';
如果此搜索查询无效,请尝试
$criteria = '(LastUpdated=2012-01-01%2B)';
因为有些rets服务器有编码相关的问题。 '%2B'是网址编码格式的' +'登录。
如果您想获得2012-01-01更新的房产, 搜索查询:
$criteria = '(LastUpdated=2012-01-01)';