Including a live EQL Data table or query from a PHP script
Updated 2009-11-09 | Filed under API | PDF
Question
I'm writing a web application in PHP. I want some data from EQL to be included on one of my PHP pages. How do I do it?
Answer
The easiest way to include the data is by reading the verbatim table data into your PHP output, like this:
<?php
readfile("http://eqldata.com/db/test1db/MyTest/Table/Junk.ehtml");
?>
You can also have the client's web browser read the data via JavaScript. We discuss this in detail in Publishing live tables and queries. This requires your client's browser to have JavaScript enabled, but it puts less load on your server since the user can read the data directly from EQL.
Finally, if you want to post-process the query results from PHP, you can read the data structure in JSON format, using code like the following:
<?php
$f = fopen("http://eqldata.com/db/test1db/MyTest/Table/Junk.json", "r");
$data = json_decode(fread($f, 1000000));
print "<pre>";
var_dump($data);
print "</pre>";
?>
The above script will set $data to contain the list of column and row objects in the table.
Related Articles
- Publishing EQL Data live tables and queries on your web site (0.535500311237)
- How to Create Queries in Microsoft Access (0.451080301302)
- User authentication, login forms, and the EqlUsers table (0.437933948937)
- Geosync Frequently Asked Questions (FAQ) (0.429345553756)
Unrelated Articles
- How EQL OnWeb Works Part 1 (0.111190167612)
- Supported Access Versions (0.120164932925)
- Database Comparisons (0.120462407103)
- How OnWeb Works Part 2 (0.124915101961)