使用 PHRETS 的搜索查询不起作用
Search Query using PHRETS not Working
我是 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";
?>
未显示结果。请尽快提供帮助。
试试这个
$search = $rets->SearchQuery("Property","ResidentialProperty",
"(ModificationTimestamp=2011-01-01T00:00:00+) ,
(ListPrice=300000)", array("Limit" => "20",
"Format" => "COMPACT","StandardNames" => "1","Count"=>1) );
我是 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";
?>
未显示结果。请尽快提供帮助。
试试这个
$search = $rets->SearchQuery("Property","ResidentialProperty",
"(ModificationTimestamp=2011-01-01T00:00:00+) ,
(ListPrice=300000)", array("Limit" => "20",
"Format" => "COMPACT","StandardNames" => "1","Count"=>1) );