简体   繁体   中英

PHRETS Error Message: Missing operator in lookup subquery

I am learning to use PHRETS to access IDX data for a real estate website. I have managed to connect and do simply queries using limits on price, character field content, etc. but I am getting an error message when I try to limit results by the listing status field.

According to RETS-MD the SystemName for the field is "Property_Status", the field type is "Character", the length is 2 and one of the potential Values is "A" (as well as others).

When I run the following code I get an error message that says "Fatal error: Uncaught PHRETS\\Exceptions\\RETSException: Missing operator in lookup subquery for field Property_Status. in C:\\xampp\\phrets\\vendor\\troydavisson\\phrets\\src\\Session.php:424"

$results = $rets->Search('Property','RESD','(List_Price=100000-105000),(Property_Status=A)');

I have also tried searching for "A*" and "*A*", same result. The strange thing is that I can do a search on other character fields which don't contain a preset list of potential values without any problems.

First of all the mentioned field "Property_Status" is a look-up field. And the syntax for including a look-up field should prefix "|"pipe symbol along with the value.

Your query should be,

$rets->Search('Property','RESD','(List_Price=100000-105000),(Property_Status=|A)');

If suppose multiple status needs to query then,

$rets->Search('Property','RESD','(List_Price=100000-105000),(Property_Status=|A,B)');

查询应该是 ((List_Price=100000-105000),(Property_Status=A))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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