First time here? Check out the FAQ!

Using Phrets....what is correct query for searching for two or more (L_City=Fairhope || L_City=Daphne)

  • retag add tags

$rets_login_url = ""; $rets_username = "ChasonWachter";

Using Phrets How do I create a query for multiple cities (but not all)
tried (L_City=Fairhope || L_City=Daphne)…...didn't work. Evidently what documentation I have found isn't correct for this...

wildgoose's avatar
asked 2018-10-21 04:47:48 -0500
edit flag offensive 0 remove flag close merge delete


ok...thanks.....related question: When looking up for example, LM_bit_34, which is "waterfront", the RETS Metadata documentation show values of either 0 or 1. (and the form agents fill out when listing a property is Y/N). So I can guess that 0 is N and 1 is Y, BUT WHERE DOES IT ACTUALLY SAY THAT? Am I missing some documentation?

wildgoose's avatar wildgoose (2018-11-18 06:18:34 -0500) edit

The field type is "Boolean" in the METADATA-TABLE which means you would use 0 or 1 to search.
The value would be returned as 0 or 1 or empty (null).
Sample searches: (LM_bit_34=.EMPTY.) (LM_bit_34=1) (LM_bit_34=0)

bwolven's avatar bwolven (2018-11-19 08:51:45 -0500) edit
add a comment see more comments

1 Answer


Either of these should work.

bwolven's avatar
answered 2018-10-22 06:00:08 -0500
edit flag offensive 0 remove flag delete link


that worked, but when I tried (L_City=Spanish Fort) I got nothing. So I tried L_Zip=36527, and got more than 36527.... What am I missing?

wildgoose's avatar wildgoose (2018-10-30 20:17:19 -0500) edit

The L_City field has a lookup attached.
When searching data fields with a lookup attached, you search with the "Value" as specified in the metadata-lookup_type from the RETS metadata.
So for RE_1 class it would be lookup: City_Lkp_1.
For "Spanish Fort" the value you search for is: SpanishFrt
When I did the search: (L_Zip=36527) it only returned that zip code.

bwolven's avatar bwolven (2018-10-31 05:37:13 -0500) edit

When searching for zip codes you may want to do it like this: (L_Zip=36527*) which will pull the ones with +4 too.

bwolven's avatar bwolven (2018-10-31 08:57:59 -0500) edit

Ok, I apparently do not know how to download the complete metadata... I don't see that anywhere. Is there an easy way to get a copy of the complete metadata via email? Also. Can you save me some time and just tell me what the lookup for L_City would be for Point Clear? (PointClr ?)

wildgoose's avatar wildgoose (2018-11-05 09:26:01 -0500) edit

The easiest way to look a the metadata is to use
You can also use PHRETS: GetLookupValues($resource_id, $lookup_name) to get the lookup.
Note: you see City_Lkp_1, the "1" in the name means the lookup is specific to class 1.
The site could have slightly different lists of cities depending on the class you are searching.

bwolven's avatar bwolven (2018-11-05 09:59:21 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer