Ask Your Question

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

asked 2018-10-21 04:47:48 -0600

$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...

edit retag flag offensive 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 gravatar imagewildgoose ( 2018-11-18 06:18:34 -0600 )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 gravatar imagebwolven ( 2018-11-19 08:51:45 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-10-22 06:00:08 -0600

Either of these should work.

edit flag offensive delete link more


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 gravatar imagewildgoose ( 2018-10-30 20:17:19 -0600 )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 gravatar imagebwolven ( 2018-10-31 05:37:13 -0600 )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 gravatar imagebwolven ( 2018-10-31 08:57:59 -0600 )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 gravatar imagewildgoose ( 2018-11-05 09:26:01 -0600 )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 gravatar imagebwolven ( 2018-11-05 09:59:21 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-10-21 04:47:48 -0600

Seen: 720 times

Last updated: Oct 22 '18