android - Getting latitude and longitude from server using PHP -


i trying build android app queries server latitude , longitude given destination. there seems error in php code shows following error when input address in web browser.

notice: undefined variable: destination in c:\xampp\htdocs\serverfiles\btc.php on line 6 {"result":[{"latitude":null,"longitude":null}]} 

this btc.php file:

<?php if($_server['request_method']=='get'){ $id  = $_get['destination']; $con = mysqli_connect("127.0.0.1", "root", "", "bustrack");  $sql = "select * updates destination='".$destination."'"; $r = mysqli_query($con,$sql); $res = mysqli_fetch_array($r); $result = array(); array_push($result,array( "latitude"=>$res['latitude'], "longitude"=>$res['longitude'], ) ); echo json_encode(array("result"=>$result)); } 

$sql = "select * updates destination='".$destination."'"; variable $destination not exist. need declare before using it. believe variable $id want, looking code.


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -