脚本宝典收集整理的这篇文章主要介绍了php – 为什么搜索查询没有在PHRETS中显示任何结果?,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
$rets_login_url = "http://sef.rets.interealty.COM/LOGin.asmx/Login"; $rets_username = "xxxxxxxx"; $rets_password = "xxxxxxxx"; $rets_user_agent = "PhrETS/1.0"; $rets_user_agent_password = "xxxxxxx"; ////////////////////////////// // start rets connection $rets = new phRETS; // Uncomment and change the following if you're connecting // to a server that supports a version other than RETS 1.5 $rets->AddHeader("RETS-Version","RETS/1.5"); $rets->AddHeader("User-Agent",$rets_user_agent); echo "+ Connecting to {$rets_login_url} as {$rets_username}<br>\n"; $connect = $rets->Connect($rets_login_url,$rets_username,$rets_password,$rets_user_agent_password); // check for errors if ($connect) { echo " + Connected<br>\n"; } else { echo " + Not connected:<br>\n"; PRint_r($rets->Error()); exIT; } $seArch = $rets->SearchQuery("ProPErty","ResidentialProperty","(ListDate=1990-01-01+)"); 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); echo "+ Disconnecting<br>\n"; $rets->Disconnect();
当我运行此脚本时,它显示连接的结果,然后断开连接.但没有找到结果.我试了很多关于结果没有显示的问题的建议,但没有什么对我有用.哪里错了?
RETS服务器:SEF RETS系统
RETS系统ID:SEFRETS
登录URL:http://sef.rets.interealty.com:80/Login.asmx/Login
RETS版本:1.5
服务器软件:Microsoft-iIS / 6.0
我也无法理解什么是$rets_modtimestamp_field =“LIST_87”;
请帮我.我需要一些关于如何从RETS获取数据的建议.
搜索查询中的一个字段是ListDate.查看包含元数据的附加excel文件,“ListDate”位于Standardnames下的B列中. RETS specification使用系统名称作为默认值(见下文).您需要指定’“StandardNames”=> SearchQuery函数的options参数中的1’:
$search = $rets-> SearchQuery(“Property”,“ResidentialProperty”,“(ListDate = 1990-01-01)”,array(“StandardNames”=> 1));
另外,请检查以确保SearchQuery的第二个参数class是正确的.为此,您可以在PHRETS中使用GetMetadataClasses功能.
您还可以使用RETS服务器URL,用户名和密码登录来使用retsmd.com.
$rets_modtimestamp_field是一个字段,它是一个日期时间值,指示上次修改列表的日期和时间.
在RETS 1.7.2规范文件http://www.reso.org/assets/RETS/Specifications/rets_1_7_2.pdf的7.4.7节中,
“查询可以在查询中使用标准名称或系统名称(第7.7节)客户端选择使用标准名称,它必须使用StandardNames来指示参数…如果此条目设置为(“0”)或不存在,则搜索中传递的字段名称为SystemNames,在元数据中定义.“
以上是脚本宝典为你收集整理的php – 为什么搜索查询没有在PHRETS中显示任何结果?全部内容,希望文章能够帮你解决php – 为什么搜索查询没有在PHRETS中显示任何结果?所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。