title: Connect android app to an External MySQL database using PHP
body: <p>I have created a login_activity for my android app. I've gone through quite a few tutorials on how to fetch data from an external MySQL database. I have access to this external MySQL database. I've followed one of them to write the following PHP code which will fetch my data from the server for my login_Activity:</p>
  
  <pre><code>&lt;?php
  error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
  
  $dbhost="localhost";
  $dbuser="";   
  $dbpass=""
  
  $connect=mysql_connect($dbhost,$dbsuer,$dbpass) or die("database selection error");
  
  $username=$_POST['username'];
  $password=$_POST['password'];
  
  $query=mysql_query("SELECT * FROM app_users_parent where Email='$username' AND Password='$password');
  $num=mysql_num_rows($query);
  
  if($num==1) {
  
  while($list=mysql_fetch_assoc($query)) {
  $output=$list;
  echo json_encode('$output');
  }
  
  mysql_close();
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>I understand I've got to place this php file onto the same server. But I don't really understand how to do that? Should I use something like FileZilla for FTP or what? 
  I could not find any tutorial on the net which shows how and where to save this php file.
  If you need my Java code where I'm connecting to this file,I could give it to you. 
  (P.S.- I just started with android so not really a pro out here. Please respect that )</p>