First time here? Check out the FAQ!
0

Having Issues Pulling Results in PhRETS

I am developing for a WordPress site and am getting an error that states: "Unexpected end of Query.". I have no idea what I'm doing wrong. I'm just putting in the example query from the documentation .

Url: http://wyo-rets.paragonrels.com/rets/...

$config = new \PHRETS\Configuration;
$config->setLoginUrl('http://wyo-rets.paragonrels.com/rets/fnisrets.aspx/WYO/login?rets-version=rets/1.7.2');
$config->setUsername('******');
$config->setPassword('******');
    $config->setRetsVersion('1.7.2'); // see constants from \PHRETS\Versions\RETSVersion
$config->setHttpAuthenticationMethod('digest'); // or 'basic' if required 
$config->setOption('use_post_method', false); // boolean
$config->setOption('disable_follow_location', false); // boolean

$rets = new \PHRETS\Session($config);

$connect = $rets->Login();
var_dump($connect);

    $results = $rets->Search(
        'Property', 
        'RE_1', 
        '*', 
        ['Limit' => 3, 'Select' => 'LIST_1,LIST_105,LIST_15,LIST_22,LIST_87,LIST_133,LIST_134']
);

foreach ($results as $r) {
    var_dump($r);
}
zslagowski's avatar
zslagowski
asked 2019-07-01 15:47:31 -0500
edit flag offensive 0 remove flag close merge delete

Comments

The Select parameter needs to be changed to use the actual field names from Paragon RETS.
Or you can use '*' to return all fields.
Also make sure to call: $rets->Disconnect() to close the session when finished.

bwolven's avatar bwolven (2019-07-01 15:52:46 -0500) edit

Were you able to get this working?

bwolven's avatar bwolven (2019-07-02 09:24:16 -0500) edit

I'm still having issues. It's saying "unexpected end of query" when I put *.

$connect = $rets->Login(); if ($connect) {

    $results = $rets->Search("Property","RE_1","*", ['Limit' => '3']);

    echo "Results: " . $results->getTotalResultsCount() . "<br/>";
    foreach ($results as $record) {
        var_dump($r);
    }

    $rets->Disconnect();
zslagowski's avatar zslagowski (2019-07-02 18:39:05 -0500) edit

If I change "*" to "L_City=GILL" it gives me no error but returns 0 results.

zslagowski's avatar zslagowski (2019-07-02 18:39:39 -0500) edit
add a comment see more comments

1 Answer

0

What is your account name (NO PASSWORD)?
Try this query: (L_ListingID=0+)

bwolven's avatar
bwolven
answered 2019-07-03 07:21:45 -0500
edit flag offensive 0 remove flag delete link

Comments

Awesome that seemed to pull in some results. I'll work with this and see what I can work with. Thanks so much!

zslagowski's avatar zslagowski (2019-07-03 16:39:27 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer