1

I've got a system running RETS through the PHRETS system. I have a form, that runs through a query to pull out results, and we're adding in multi-select boxes.

So far, my code looks like this for the query: (SUB_AREA_NAME=|AreaA,AreaB,AreaC,AreaD) This works for allowing many results to come up. Problem is this:

For some reason, the system is doing a 'and' operation instead of an 'or' operation. So anytime we search up more then one place, if any of the results come up empty, they will all come up empty.

For example:

Lets say AreaA has 3 houses. AreaB has 0 houses, AreaC has 10 houses, and AreaD has 1 house.

If you look up: AreaA + AreaC you will get 13 results.
AreaA + AreaC + AreaD you will get 14 results.
AreaD by itself you will get 1 result.

AreaA + AreaB you will get 0 results.
AreaA + AreaB + AreaC + AreaD you will get 0 results.

Basically, because AreaB has no results, if you query that area with any other area that does have results, it will still come up as no results.

I need to know how to query multiple selections from one category, while showing all the results even if one area doesn't have any.

Thanks.

Nicole
  • 123
  • 3
  • 16

1 Answers1

1

Some (most) RETS server implementations are not done correctly. Your query is right according to RETS specs. You just need to find out what will work for your particular situation.

For example, you could try ((SUB_AREA_NAME=AreaA)|(SUB_AREA_NAME=AreaB)|(SUB_AREA_NAME=AreaC)|(SUB_AREA_NAME=AreaD)) and see if that works.

In some cases I've seen this work, notice I removed the pipe even though that is the OR conjunction, (SUB_AREA_NAME=AreaA,AreaB,AreaC,AreaD)

Other times it won't work with the commas and you need to use 4 seperate queries.

And even other times I have see the server foul up and not encode the commas properly so you have to do something like this (SUB_AREA_NAME=|AreaA%2CAreaB%2CAreaC%2CAreaD)

Anthony Hatzopoulos
  • 10,437
  • 2
  • 40
  • 57
  • in your experience what could be a solution for retrieve the photos if the system i'm using doesnt support get the url, only get the binary data back? I'm not decided to store all photos, I think is wrong store all images – Emilio Gort Nov 20 '13 at 02:29
  • 1
    Well in your case you have no choice. The IDX provider doesn't want to pay for hotlink bandwidth so you have to host them yourself. If you like only store the images for listings belonging to your real estate targeted areas the agents are 'farming'. – Anthony Hatzopoulos Nov 20 '13 at 16:11
  • thanks...good idea...i have no other choice..`only store the images for listings belonging to your real estate targeted areas the agents are 'farming'` – Emilio Gort Nov 20 '13 at 16:48