0

Once I update MySQL and return to the display - being a SELECT, UPDATE or Sort sometimes the display will not update the results, which means I need to refresh the browser. It would seem that the MySQL DB does not update in time before returning to the display.

Hope I have made myself clear.

Is there away to delay the time before returning to the display from the update.

function getJobsResult()
{
  require "connection.php";
  $mysql_query = "SELECT * FROM Job"];

  $result = mysqli_query($conn,$mysql_query) or die('This is the die query error');

//check the result


  if(mysqli_num_rows($result)>0)
  {
    while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
        {

        $JobId = $row["job_id"];
        $date =$row["date"];
        $number =$row["number"];
        $street =$row["street"];
        $town = $row["town"];
        $city = $row["city"];
        $postcode = $row["postcode"];
        $eta=$row["eta"];

       $longlist .= $JobId.",".$number.",".$street.",".$date.",".$town.",".$city.",".$postcode.",".$eta."**";

    }

     return $longlist;

    }
    mysqli_close($conn);

}
aircraft
  • 25,146
  • 28
  • 91
  • 166
Mark James
  • 481
  • 2
  • 6
  • 18
  • 2
    Could you please provide some code? We would appreciate a minimal, complete and verifiable example http://stackoverflow.com/help/mcve – Psi Mar 10 '17 at 22:28
  • I know what could be: you are problably under NGINX, that creates a cache of the page (that last like 1 second). Please use Jquery, javascript or even PHP to delay the reload, I wait for your answer. – Marcelo Agimóvel Mar 10 '17 at 22:32
  • Sound like a possibility - how can I delay via php – Mark James Mar 10 '17 at 22:33
  • The above function is called several times from another Php file that displays the data. Sometimes it seems that the screen update does not fetch the data, sometimes only some rows. – Mark James Mar 10 '17 at 23:10
  • Not same problem @Zoxac – Mark James Mar 11 '17 at 07:25

0 Answers0