PHP does not write full HTML code randomly

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Pastrovick

    PHP does not write full HTML code randomly

    When writing an HTML table after a PHP database query very
    occasionally (1 out of ten times -- same code) the HTML page is
    truncated and cells/or full final rows of table are missing. Looking
    at the page source the code is truncated at some final point at the
    end.

    I load records in an array through a loop and then use another loop to
    render the html with embbeded php array variables to draw the html
    table.

    I thought this could be related to cache or may be solved using flush
    function??

    I come from ASP and never happened in ASP code.

    When I reload the table draws correctly.


    Thanks
  • Alvaro G Vicario

    #2
    Re: PHP does not write full HTML code randomly

    *** John Pastrovick wrote/escribió (26 Feb 2004 10:21:18 -0800):[color=blue]
    > When writing an HTML table after a PHP database query very
    > occasionally (1 out of ten times -- same code) the HTML page is
    > truncated and cells/or full final rows of table are missing.[/color]

    Sometimes, such a thing happens when table is large and scripts takes too
    much time to execute. Find out whether this makes any difference:

    ini_set('max_ex ecution_time', 3600);



    --
    --
    -- Álvaro G. Vicario - Burgos, Spain
    --

    Comment

    • Markus Ernst

      #3
      Re: PHP does not write full HTML code randomly

      "Alvaro G Vicario" <alvaro_QUITAR_ REMOVE@telecomp uteronline.com> schrieb im
      Newsbeitrag news:d0y12i9jv2 w9$.19pfxbx6og7 zr$.dlg@40tude. net...[color=blue]
      > *** John Pastrovick wrote/escribió (26 Feb 2004 10:21:18 -0800):[color=green]
      > > When writing an HTML table after a PHP database query very
      > > occasionally (1 out of ten times -- same code) the HTML page is
      > > truncated and cells/or full final rows of table are missing.[/color]
      >
      > Sometimes, such a thing happens when table is large and scripts takes too
      > much time to execute. Find out whether this makes any difference:
      >
      > ini_set('max_ex ecution_time', 3600);[/color]

      Some providers do not allow to change the max_execution_t ime. Do you get a
      timeout error message?

      You could try if error_reporting (E_ALL) triggers some error messages;
      suppressed error messages need time which could cause a timeout.

      I had once a page with complex claculations that timed out before all was
      finished. The speed was about 15 loops per second. That's why I learnt about
      error_reporting (E_ALL). After writing this line to the top of my script I
      got some thousands of notice level errors. So I cleaned up the code, and
      after that the speed had improved to more than 40 loops per second.

      Anyway, at the moment I am arguing with a client's hosting provider who
      seems not to allow error messages at all. Instead of a parse error I just
      get a blank page...

      --
      Markus


      Comment

      • John Pastrovick

        #4
        Re: PHP does not write full HTML code randomly

        Alvaro G Vicario <alvaro_QUITAR_ REMOVE@telecomp uteronline.com> wrote in message news:<d0y12i9jv 2w9$.19pfxbx6og 7zr$.dlg@40tude .net>...[color=blue]
        > *** John Pastrovick wrote/escribió (26 Feb 2004 10:21:18 -0800):[color=green]
        > > When writing an HTML table after a PHP database query very
        > > occasionally (1 out of ten times -- same code) the HTML page is
        > > truncated and cells/or full final rows of table are missing.[/color]
        >
        > Sometimes, such a thing happens when table is large and scripts takes too
        > much time to execute. Find out whether this makes any difference:
        >
        > ini_set('max_ex ecution_time', 3600);
        >
        >
        >
        > --[/color]

        The query involves 150 rows but they are stored in an array for
        average counts and only a screen page (32 rows) is finaly drawn. 150
        is not that many any way. I have to try that time execution limitation
        but the query does no take so long. I tend to think that it is due to
        the php variables embedding in html.

        Saludos

        Comment

        • John Pastrovick

          #5
          Re: PHP does not write full HTML code randomly

          Error reporting is set to E_ALL in my dev server. No errors are
          reported but when I reload the page repeatedly and quickly, some html
          codes appear but quickly disappear covered by the drawn table.

          The page does get drawn but is truncated at the end though no errors
          or strange caracters appear that might hint me as to what caused the
          problem, just the incomplete table wirh missing cells at the end.

          I find this strange since nothing similar ever happened with ASP code
          embbeded in html.

          Comment

          Working...