A RETS Query with a limited fields in SELECT ..

1,402 views
Skip to first unread message

Tanveer

unread,
Feb 6, 2010, 2:43:21 AM2/6/10
to PHRETS
I am new to the world of RETS and would appreciate an incite into how
can I formulate a query [using PHRets] like SELECT MLNumber,
LastModificationDateTime FROM Property->Comi, I want the result set to
include only a limited no. of columns e.g., MLNumber and
LastModificationDateTime fields in the example above.
Thanks,

camidoo

unread,
Feb 6, 2010, 9:15:04 AM2/6/10
to PHRETS
You would do something like below:

$search = $rets->SearchQuery($resource, $class, "(L_Status=|
1_0,1_1,1_2)", array("Format" => "COMPACT", "Select" => "L_Status,
L_ListingID"));

The important piece being the [optional] array in ->SearchQuery(string
resource, string class, string query, [array options])

You can pass in a key of "Select" and a comma delimited list of column
names to limit the columns returned to those you specify.

Troy Davisson

unread,
Feb 6, 2010, 1:12:18 PM2/6/10
to phr...@googlegroups.com
If you look at http://retsdoc.onconfluence.com/display/rets172/7.4+Optional+Request+Arguments , the options are described there.  I've also updated the http://troda.com/projects/phrets/index.php?title=SearchQuery page to describe the defaults that PHRETS uses unless they're overridden.
 
As mentioned before, the "Select" option allows you to limit what fields the server will return which can make many requests a lot faster if you don't have a need for the hundreds that are usually there.


--
You received this message because you are subscribed to the Google Groups "PHRETS" group.
To post to this group, send email to phr...@googlegroups.com.
To unsubscribe from this group, send email to phrets+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/phrets?hl=en.


Reply all
Reply to author
Forward
0 new messages