Ask Your Question
0

How to count total number of records

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

chaitanya gravatar image

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

RETS URL : http://maxebrdi.rets.fnismls.com/Rets... 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
0

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

DACO gravatar image

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
0

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.

https://github.com/troydavisson/PHRETS

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 45 times

Last updated: Aug 09