Newer
Older
GpsTracker / servers / php / getallroutesformap.php
@Nick Fox Nick Fox on 12 Sep 2014 379 bytes fixed fetch problem in php server code
<?php

    include 'dbconnect.php';
    
    $stmt = $pdo->prepare('CALL prcGetAllRoutesForMap();');
    $stmt->execute();

    $json = '{ "locations": [';

    foreach ($stmt as $row) {
        $json .= $row[2];
        $json .= ',';
    }

    $json = rtrim($json, ",");
    $json .= '] }';

    header('Content-Type: application/json');
    echo $json;

?>