Thanks for all. It works fine On Fri, Aug 19, 2016 at 10:47 PM, Sean Beckett <[email protected]> wrote:
> The API port is 8086, not 8083. https://docs.influxdata. > com/influxdb/v0.13/concepts/api/ > > On Fri, Aug 19, 2016 at 9:06 AM, <[email protected]> wrote: > >> 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\ven >> dor\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\ven >> dor\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/ms >> gid/influxdb/5560013f-d681-46fc-9ca9-a669a3004f62%40googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Sean Beckett > Director of Support and Professional Services > InfluxDB > > -- > Remember to include the InfluxDB version number with all issue reports > --- > You received this message because you are subscribed to a topic in the > Google Groups "InfluxDB" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/influxdb/fWvTb-sGSIQ/unsubscribe. > To unsubscribe from this group and all its topics, 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/CALGqCvNpT01j8BxK_cZSt02NKDv0PP27jn91Cp5uV1B0C- > A-kA%40mail.gmail.com > <https://groups.google.com/d/msgid/influxdb/CALGqCvNpT01j8BxK_cZSt02NKDv0PP27jn91Cp5uV1B0C-A-kA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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/CA%2BKbuGXseM81jXqtGdM7K09YnDLw9AGqOW87oZzu8Ef_4aRGSw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
