Created
September 12, 2013 13:09
-
-
Save ErikRamses/6537004 to your computer and use it in GitHub Desktop.
Obtener posición
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$response = array(); | |
require_once __DIR__ . '/db_connect.php'; | |
$db = new DB_CONNECT(); | |
$result = mysql_query("SELECT * FROM RUTAS") or die(mysql_error()); | |
if (mysql_num_rows($result) > 0) { | |
$response["results"] = array(); | |
while ($row = mysql_fetch_array($result)) { | |
// temp user array | |
$ruta = array(); | |
$ruta["Ruta"] = $row["Ruta"]; | |
$ruta["Camion"] = $row["Camion"]; | |
$ruta["Lat"] = $row["Latitud"]; | |
$ruta["Lng"] = $row["Longitud"]; | |
array_push($response["results"], $ruta); | |
} | |
$response["success"] = 1; | |
echo json_encode($response); | |
} else { | |
$response["success"] = 0; | |
$response["message"] = "Not found"; | |
echo json_encode($response); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment