function query_latest($count = 100) { $db = DB::connect(DB_CONNECTION_STRING); $sql = "select council_reference, address, postcode, description, info_url, comment_url, map_url, x, y, date_recieved, date_scraped, full_name\n\t\t\t\t\tfrom application \n\t\t\t\t\tinner join authority on application.authority_id = authority.authority_id\n\t\t\t\t\torder by date_scraped desc limit " . $count; $application_results = $db->getAll($sql); return applications::load_applications($application_results); }
* version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Also add information on how to contact you by electronic and paper mail. * * Greenfield Technologies Ltd., hereby disclaims all copyright interest in * the library `phpari' (a library for creating smart telephony applications) * written by Nir Simionovich and its respective list of contributors. */ require_once "../vendor/autoload.php"; try { $conn = new phpari("hello-world"); //create new object $app = new applications($conn); $result = $app->applications_list(); if (!$result && count($result)) { throw new Exception("phpari error occured", 503); } echo json_encode($result); exit(0); } catch (Exception $e) { echo "Error: " . $conn->lasterror . "\n"; echo "Trace: " . $conn->lasttrace . "\n"; }