Newer
Older
GpsTracker / servers / php / getroutes.php
@Nick Fox Nick Fox on 12 Sep 2014 364 bytes fixed fetch problem in php server code
<?php
    include 'dbconnect.php';

    $stmt = $pdo->prepare('CALL prcGetRoutes();');
    $stmt->execute();

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

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

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