Re: PHP/DB speed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robin Kopetzky wrote:
Good afternoon!

I am writing a project and have a speed concern...

The code I am using is thus and is retrieving around 2,500 records:

	$result = mysql_query($sql)
	while ($row = mysql_fetch_array($result))
	{
		build <OPTION> stmt
	}

	Is there a faster method? Timed this with microtime and .9 seconds to
retrieve the data and output the web page seems REAL slow. Now this is on a
T-Base-100 network but I imagine it would be like watching paint dry in a
56K modem. Any thoughts, ideas on accelerating this? I did try ob_start()
and ob_end_flush() and no help...

Any time you put 2500 elements into a SELECT box, it's going to be slow. The browser is going to take a noticable time rendering that box.


Are you actually building the <option> list up in a variable before displaying it or just echoing it outright? Building the whole thing up into a variable will take longer than just echoing it directly to the browser.

Other than that, if you're not willing to change your UI so you don't have a 2500 element select box, there's not much you can do.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux