How to write query in phrets

3.6k views Asked by At

Can you help me, I have got success in getting result by this code

 $search = $rets->Search("Property","RESI","(MLNumber=0+)");

 print_r($search);

But when I do query with multiple options, it shows error in debug file RETS ReplyCode="20206" ReplyText="Invalid Query Syntax."

And for this error my php code is

$search = $rets->Search("Property","RESI","(City=Lexington),(Status=Sold)");

print_r($search);

I have found that search should be done in specific pair, here http://www.rapattoni.com/supp/mls/rets/documents/PDF/RETS1_5_Product_Release_Notice.pdf

I'm not able to find where I'm wrong.

Thanks

2

There are 2 answers

1
Gaurav Rai On BEST ANSWER

Anyways this answer is too late, but still I'm posting may be it be helpful for others. The search query should be written in specific pairs as mentioned in the above PDF file like

$search = $rets->Search("Property","RESI","(MLNumber=0+),(StatusDate=2013-06-01-2013-09-01)");

IMPORTANT: This is for rapattoni mls, this may differ from MLS to MLS.

I hope this would be helpful to someone.

4
dj_goku On

If you just search for (City=Lexington) does it return results? Are you sure (Status=Sold) is correct? The syntax looks valid.

What MLS are you doing searches against?