Jump to content

Search the Community

Showing results for tags 'ob_start'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. My web-page loops through and echoes all 50,000 entries from a several-column mySQL database (part number, price, description, etc.). It is tedious for me, because It takes about a full minute for my browser to completely load it. I had an idea: Use "ob_start" at the beginning of the script, and insert an "ob_end_flush()" assertion in my "while" loop to get executed every 50 loops, like this: <?php ob_start(); ## access big mySQL database and output it to browser $i=0; while ( $a_row = mysql_fetch_assoc($result) ) { # echo output to browser if($i %50 == 0) { ob_end_flush(); } } ?> That cut the time down from 60 seconds down to about a second and a half. The problem is, the results are goofy (several mySQL rows missing, didn't get output to browser). Is there a better way? Or, am I on the right track? And, if I'm on the right track, what can I do to fix this? Thank you.
  2. Hey All, Need to pass the current window width to a PHP class which creates a slide show presentation. The presentation image sizes need calculated for all devices including mobile and smart phone (mobile web). Problem is, PHP is server side and doesn't care about the windows width. I'm using Javascript to acquire the window width and pass that value to PHP - before calling the class that create the presentation. My workaround is using Output Buffering: <php ob_start(); //starts buffering ?> <script> var wwidth = screen.width; document.write(wwidth): //output </script> <?php $windowwidth = ob_get_clean(); //works error_log("Window width is: ".$windowwidth); //continue on with the rest of the script ?> I dislike ducking in and out of PHP like this. And I'm not able to use Javascript XMLHttpRequest because I need the size before the class is called, on the current page. Any alternative suggestions? Thanks in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.