title: Concatenate URL with two variables
body: <p>What I am doing is getting latitude and longitude from databases and displaying it in $row['latitude'] format. Now what I want to t to do is which ever hyperlink user clicks it takes him to maps.google.com and show location against that particular latitude and longitude.</p>
  
  <p>please help! Here is my PHP code.</p>
  
  <pre><code>    &lt;?php
  
      $location=$_POST["location"]; 
      $myArray = json_decode($location,true);
      $jsonArray = $myArray[0];
      $longitude = $jsonArray['longitude']; $adress = $jsonArray['adress'];
      $con=mysqli_connect("","","","");
     // Check connection if (mysqli_connect_errno())   {   echo "Failed to
     connect to MySQL: " . mysqli_connect_error();   }
  
     $sql = "INSERT INTO chokh_db. gpslocations (     latitude,   longitude ,
     datetime     ) VALUES ( '$latitude' , '$longitude' ,  NOW() );";
  
  
  
   if (!mysqli_query($con,$sql)) {
     die('Error: ' . mysqli_error($con)); } $result = mysqli_query($con,"SELECT * FROM      _db. gpslocations where
        latitude &lt;&gt; 0");
  
          while($row = mysqli_fetch_array($result))   {       
              $lat = $row['latitude'];    
              $long = $row['longitude']   
              echo $row['datetime'] . 
                  "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;" .          
                  $row['latitude'] .
                  "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;" .
                  $row['longitude'] ;      
              $url = "http://maps.google.com/?q='.$lat,$long.' "; 
              echo "&lt;a href='$url'&gt;View&lt;/a&gt;";    echo "&lt;br&gt;";   
          }
          mysqli_close($con);
  
      ?&gt;
  </code></pre>