title: Querying Fusion-Table from PHP
body: <p>My case is as follows:
  I have a MySQL database which I exported and inserted in Fusion Table. Now I need to modify the php page in querying the data from the Fusion Table instead of the localhost db.</p>
  
  <p>I've read about querying Fusion-Tables from the Developers guide, but it refers to a GData Java Library and the SQL API. On another site I saw there were other libraries that can be used for querying, including Zend framework where PHP relies on, which is relevant in my case. However, I haven't stumbled upon any sample or tutorial which simply shows a php page on how you can query a simple cell, row or column from where I can just modify and improve the coding to apply it on the design.  </p>
  
  <p>My questions are:</p>
  
  <ol>
  <li><p>Do I need to install/upload on the hosting space some library?</p></li>
  <li><p>Is there a php sample &amp; tutorial on querying Fusion Table data, I might have missed? </p></li>
  <li><p>Can anyone provide me with a clue how you would query for example the Latitude info of the row with ID 5? (pages are retrieved using the path: articles.php?lang=en&amp;pg=comm_en&amp;m=view&amp;commID=88</p></li>
  </ol>
  
  <p>Below is the coding I have in comm_en.php page, which queries from PHP to SQL the data. </p>
  
  <p>Thank you in advance!</p>
  
  <p>Drini</p>
  
  <pre><code>&lt;?php
  session_start();
  foreach ($_REQUEST as  $key =&gt; $value){
      $$key=addslashes(htmlspecialchars(strip_tags($value)));
  }
  if(isset($_GET["m"]))       {$m=$_GET["m"];}            else     {$m="";}
  if(isset($_GET["commID"]))      {$commID=$_GET["commID"];}    else {$commID=1;}
  if(isset($_GET["lang"]))        {$lang=$_GET["lang"];}   
  else {$lang="en";}
  
  Shfaq($m,$commID);
  
  function Shfaq($metod,$commID)
   {
  switch($metod)
  {
   case "view":
          {View($commID);}        
      break;
   case "default":
          {View($artID);}      
      break;
  
  }
  }  // end of Shfaq();
  
  
  function View($commID)
  {
       $link =mysql_connect("localhost", "db-user", "db-pass") or die ("E pamundur lidhja!");
  mysql_select_db("DataBase-name") or die (mysql_error());
  $queryComm = "SELECT * FROM communities WHERE id ='$commID' LIMIT 0,1";
  $commRes=mysql_query($queryComm) or die(mysql_error());
  $comm=mysql_fetch_array($commRes);  
  $healthPerc = round(($comm["healthBooklet"]/$comm["totalChildNo"]), 3)*100 ;
  
  echo '      &lt;table class="gpsbox" align="right"&gt;
          &lt;caption&gt;GPS Location&lt;/caption&gt;                   
          &lt;tr&gt;&lt;td&gt;Latitude &lt;/td&gt;&lt;td&gt;'.$comm["latitude"].'&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Longitude&lt;/td&gt;&lt;td&gt;'.$comm["longitude"].'&lt;/td&gt;&lt;/tr&gt; 
      &lt;/table&gt;....&lt;html coding continues&gt;
  </code></pre>