title: Getting an Array of objects using JSON with WHERE clause coming from an Android App
body: <p>I need to get this array of objects from a php file to be transfered in my android app. My php file has no errors and capable of fetching data with <code>WHERE</code> clauses. My problem is that I need to fetch a data from my app in order to use as a where clause in my php file.</p>
  
  <p>I used 3 classes in order to serve as a dataparser, downloader, cursoradapter(not important).</p>
  
  <p><strong>PHP Part:</strong></p>
  
  <pre><code>        case 'getMsg':
          $host = 'localhost';
          $user = 'u499431357_pg1';
          $pass = 'preggorie';
          $db = 'u499431357_pg1';
  
              $idPreg = (int)($_GET['idPreg']);
              $con = mysqli_connect ($host, $user, $pass, $db) or die ('Unable to Connect');
  
              if (mysqli_connect_error ($con)){
                  echo "Failed to connect";
              }
  
              $query = mysqli_query ($con, "SELECT * FROM msgPreg where pregId = '$idPreg'");
  
              if ($query){
                  while($row = mysqli_fetch_array ($query)){
                      $flag [] = $row;
                  }
                  print (json_encode($flag));
              }
                  mysqli_close($con);
  
              break;
  </code></pre>
  
  <p><strong>Downloader:</strong></p>
  
  <p><a href="http://pastebin.com/xRHU0FEM" rel="nofollow noreferrer">http://pastebin.com/xRHU0FEM</a></p>
  
  <p><strong>DataParser:</strong></p>
  
  <p><a href="http://pastebin.com/tUZ9GM66" rel="nofollow noreferrer">http://pastebin.com/tUZ9GM66</a></p>
  
  <p>** I don't know where to put the id that I need in order to get it from my php file. Please help :(</p>