title: Bluehost MySQL and phpmyadmin select sql service.php running slow while insert, delete, and update commands works instantly
body: <p>I am using crud commands in an app and my commands for insert, delete and update in sql work instantly. The select query in my php file called service loads in a few hours. I was wondering what was causing this. It doesn't really make since to me considering the other commands work instantly. Besides it not loading in my app I have it in a website where I can view my table with the php file. This does not load either...</p>
  <p>I have my service on a website secured with HTTPS, is there anything on bluehost that I need to change in settings? I also posted my code below for my php file. I've tried a few other coded formats and commented these out of which none work anyway. This leads me to believe this is some setting in bluehost. Anyone else with the same problems and found a solution they could share or any ideas of why this is happening?</p>
  <pre><code>&lt;?php
     
  $start = microtime(TRUE);
  error_log('Connecting');
  // Create connection
  $connection=mysqli_connect(&quot;localhost&quot;,&quot;mlbroadv_admin&quot;,&quot;DpApp&amp;483&quot;,
  &quot;mlbroadv_PlantAssistDB&quot;);
   
  // Check connection
  if ($connection == false) {
      die(&quot;ERROR: Could not connect. &quot;
                  .mysqli_connect_error());
  }
   
  // This SQL statement selects ALL from the table 'Locations'
  
  
  error_log('Connection took' . microtime(TRUE) - $start);
  // Check connection
  // if ($connection == false) {
  //     die(&quot;ERROR: Could not connect. &quot; .mysqli_connect_error());
  // }
  // This SQL statement selects ALL from the table 'Locations'
  //$sql = &quot;SELECT * FROM Notes&quot;;
  $sql = &quot;SELECT * FROM Notes&quot;;
  
  error_log('Running select');
  if ($result = mysqli_query($connection, $sql)){
      error_log('Select took' . microtime(TRUE) - $start);
      // If so, then create a results array and a temporary one
      // to hold the data
      $resultArray = array();
      // Loop through each row in the result set
      error_log('looping fetch');
      while($row = $result-&gt;fetch_object())
      {
          error_log('Fetch is running at ' . microtime(TRUE) - $start);
          // Add each row into our results array
          $resultArray[] = $row;
      }
      // Finally, encode the array to JSON and output the results
      echo json_encode($resultArray);
  }
  error_log('Fetch is done at ' . microtime(TRUE) - $start);
  // Close connections
  mysqli_close($connection);
  error_log('Connection closed at ' . microtime(TRUE) - $start);
  ?&gt;
  </code></pre>
  <p>EDIT</p>
  <p>Results for time</p>
  <pre><code>[27-Jul-2022 07:17:15 America/Boise] Connecting
  [27-Jul-2022 07:17:15 America/Boise] Connection took0.010892868041992
  [27-Jul-2022 07:17:15 America/Boise] Running select
  [27-Jul-2022 07:17:15 America/Boise] Select took0.012121915817261
  [27-Jul-2022 07:17:15 America/Boise] looping fetch
  [27-Jul-2022 07:17:15 America/Boise] Fetch is running at 0.012276887893677
  [27-Jul-2022 07:17:15 America/Boise] Fetch is running at 0.012364864349365
  [27-Jul-2022 07:17:15 America/Boise] Fetch is running at 0.012436866760254
  [27-Jul-2022 07:17:15 America/Boise] Fetch is running at 0.012504816055298
  [27-Jul-2022 07:17:15 America/Boise] Fetch is done at 0.012606859207153
  [27-Jul-2022 07:17:15 America/Boise] Connection closed at 0.012848854064941
  </code></pre>