Hello all,

I could establish connection, but when it comes to query. JSON error happens. 
Since new to this, i am trying to resolve. Any help is warm welcomed and thanks.

Regards
Abel

<?php
require '/vendor/autoload.php';

    $client = new InfluxDB\Client('153.148.25.44', '8083');
    $database = $client->selectDB('Meters');
    $result = $database->getQueryBuilder()
    ->select('*')
    ->from('GDATA')
    ->limit(2)
    ->getResultSet()
    ->getPoints();

    //$result = $database->query('select * from  GDATA limit  LIMIT 5;');
    //$points = $result->getPoints();
    //$lastQuery = $client->getLastQuery();

    echo '<pre>';
    var_dump($result);
?>
Tested database connection, it is working.

Fatal error: 
Uncaught exception 'InvalidArgumentException' with message 'Invalid JSON' in
C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\InfluxDB\ResultSet.php:30

Stack trace: #0 
C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\InfluxDB\Driver\Guzzle.php(100):
InfluxDB\ResultSet->__construct('404 page not fo...')

#1 
C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\InfluxDB\Client.php(198):
InfluxDB\Driver\Guzzle->query()

#2 
C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\InfluxDB\Database.php(78):
InfluxDB\Client->query('Meters', 'SELECT * FROM "...', Array)

#3 
C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\InfluxDB\Query\Builder.php(261):
InfluxDB\Database->query('SELECT * FROM "...')

#4 C:\xampp\htdocs\projectone\home.php(10): 
InfluxDB\Query\Builder->getResultSet()

#5 {main} thrown in 
C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\InfluxDB\ResultSet.php
on line 30

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/5560013f-d681-46fc-9ca9-a669a3004f62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to