title: Android and PHP - multiple values for each row of the array
body: <p>I want to create an array which contains multiple values(ex. Latitude,Longitude) for each row.</p>
  
  <p>I've tried this in my PHP code:</p>
  
  <pre><code>&lt;?php
         $latitudeFrom =$_POST['latitudeFrom'];
         $longitudeFrom =$_POST['longitudeFrom'];
         $radius=$_POST['radius'];
  
         $conn=mysql_connect($hostname,$user,$pass);
  
         $db=mysql_select_db('my_finditdatabase');
  
  //$latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, 
         $earthRadius = 6371000;
  
         $ris=mysql_query("SELECT * FROM Parcheggio;")or die('died');
         $riga=mysql_fetch_array($ris);
         $i=0;
         while($riga)
         {
               $latitudeTo=$riga['Latitudine'];
               $longitudeTo=$riga['Longitudine'];
  
               //print "lat:{$latitudeTo}   lon:{$longitudeTo}  ";
               // convert from degrees to radians
               $latFrom = deg2rad($latitudeFrom);
               $lonFrom = deg2rad($longitudeFrom);
               $latTo = deg2rad($latitudeTo);
               $lonTo = deg2rad($longitudeTo);
               //print "___lat:{$latTo}___lon:{$lonTo}  ";
               $latDelta = $latTo - $latFrom;
               $lonDelta = $lonTo - $lonFrom;
  
               $angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) +
               cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));
               $dist= $angle * $earthRadius;
               //print "====dist:{$dist}  &lt;br&gt;  ";
               if($dist&lt;=$radius){
                    //print "&lt;br&gt;&lt;br&gt; Ci sono  ";
                    $Citta=$riga['Citta'];
                    $Via=$riga['Via'];
                    $Provincia=$riga['Provincia'];
                    $NumCivico=$riga['NumCivico'];
                    //print "&lt;br&gt;&lt;br&gt; Citta:{$Citta}--Via: {$Via}--Provincia:{$Provincia}---NumCivico:{$NumCivico}  &lt;br&gt;";
  
                    $newdata=array("Citta" =&gt; $Citta, "Provincia" =&gt; $Provincia , "Via" =&gt; $Via , "NumCivico" =&gt; $NumCivico ,"Latitude" =&gt; $latitudeTo , "Longitude" =&gt; $longitudeTo);
                    array_push($md_array[$i],$newdata);
                    $i++;
              }
              $riga=mysql_fetch_array($ris);
         }
         print(json_encode($arr));
  
         mysql_close();
  ?&gt;
  </code></pre>
  
  <p></p>
  
  <p>If it enter in the IF BLOCK it should add a row to te array with theese values:
  </p>
  
  <pre><code> $newdata=array("Citta" =&gt; $Citta, "Provincia" =&gt; $Provincia , "Via" =&gt; $Via , "NumCivico" =&gt; $NumCivico ,"Latitude" =&gt; $latitudeTo , "Longitude" =&gt; $longitudeTo);
   array_push($md_array[$i],$newdata);
  </code></pre>
  
  <p><strong>I would say if this method functions and how I could print the array and read it from my Java class that makes the http request.</strong></p>