title: PHP Code works in LocalHost but not on Server
body: <pre><code>&lt;?php
  
     $host = &quot;MY_HOST&quot;;
      $username = &quot;MY_USERNAME&quot;;
      $password = &quot;MY_PASSWORD&quot;;
      $connection = mysqli_connect($host, $username, $password);
  
  
  if(!$connection)
     die(&quot;TRY AGAIN: &quot; . mysqli_error());
  
  
  $DBQuery = &quot;USE MY_DB&quot;;
  mysqli_query($connection, $DBQuery);
  
    $queryResult = $connection-&gt;
        query(&quot;SELECT * FROM MY_TABLE&quot;);
  
    $result = array();
  
    while ($fetchdata=$queryResult-&gt;fetch_assoc()) {
        $result[] = $fetchdata;
    }
  
    echo json_encode($result);
  ?&gt;
  </code></pre>
  <p>When i go to localhost/FILE_PATH/fetch.php
  I get the full data in JSON form</p>
  <p>When i upload it on server and go to https://www/MYSITE.com/FILE_PATH/fetch.php
  I get the message TRY AGAIN:</p>
  <p>Is there something im missing out while trying to retrieve message from server?
  Im using aws rds mysql</p>
  <p>Ive put my file inside var/www/html of my server. Am i supposed to put it in htdocs or something? if so, how do i reference to the file</p>