Ask Your Question

How to count total number of records

asked 2018-02-14 12:22:03 -0600

updated 2018-02-14 12:24:18 -0600

RETS URL : Username: CCAR_Mooveguru

How can I query to find count of total records using phRETS. For ex. Count of active property. Thanks in advance.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2018-08-09 07:26:23 -0600

updated 2018-08-09 07:27:01 -0600

Keep in mind your query will be returned as a JSON array object. So you can easily COUNT the number of records within the object with code like: count($queryResults)

For Example Let's say your query is all set up and you are ready to send it to the RETS server. Once the query is completed, you simply get a COUNT of records contained in the $queryResults array variable.

$queryResults = $session->Search("Property", $propertyClass, $mlsQuery);
$recordCount = count($queryResults);
edit flag offensive delete link more

answered 2018-02-14 15:13:16 -0600

updated 2018-02-14 15:30:00 -0600

I'm not real familiar with PHRETS. RETS requires you pass in parameter Count=2 to return only the count. You can check with the PHRETS documentation on GitHub to see how to do this.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-02-14 12:22:03 -0600

Seen: 550 times

Last updated: Aug 09 '18