我是PHRETS的新手。并且需要构建一个可以使用PHRets和Rets Server进行搜索和显示的搜索面板。这里它已经连接但没有显示结果。我想要能够很好地显示结果的东西。
的search.php
<?php
$rets_login_url = "http://connectmls-rets.mredllc.com/rets/server/login";
$rets_username = "xxxxxxxx";
$rets_password = "xxxxxxxx";
require_once("phrets.php");
$rets = new phRETS;
//echo "+ Connecting to {$rets_login_url} as {$rets_username}<br>\n";
$connect = $rets->Connect($rets_login_url, $rets_username, $rets_password);
//echo "<pre>";
//print_r($rets);
//echo "</pre>";
if ($connect) {
echo "<p class=\"success\">Connected</p>";
////////////////////////////////////////////////////////
$search = $rets->SearchQuery("Property","ResidentialProperty","(ListDate=1990-01-01+)",array("StandardNames" => 1));
while ($listing = $rets->FetchRow($search)) {
echo "Address: {$listing['StreetNumber']} {$listing['StreetName']}, ";
echo "{$listing['City']}, ";
echo "{$listing['State']} {$listing['ZipCode']} listed for ";
echo "\$".number_format($listing['ListPrice'])."\n";
}
$rets->FreeResult($search);
////////////////////////////////////////////////////////
}
else {
echo "<p class=\"error\">Not connected:<p>";
print_r($rets->Error());
exit;
}
if (!empty($rets->err)) {
echo "HTTP {$rets->err}\n";
}
$last_req = $rets->LastRequest();
if ($last_req['ReplyCode'] != 0) {
echo "RETS {$last_req['ReplyCode']}: {$last_req['ReplyText']}\n";
}
//echo "Server reports: ".$rets->GetServerVersion()."\n";
?>
&#13;
没有显示结果。请尽可能地帮助。
答案 0 :(得分:1)
试试这个
$search = $rets->SearchQuery("Property","ResidentialProperty",
"(ModificationTimestamp=2011-01-01T00:00:00+) ,
(ListPrice=300000)", array("Limit" => "20",
"Format" => "COMPACT","StandardNames" => "1","Count"=>1) );