Computing.Net > Forums > Programming > PHP error

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

PHP error

Reply to Message Icon

Name: sunny
Date: December 8, 2004 at 08:25:23 Pacific
OS: win XP
CPU/Ram: P4/256
Comment:

iam working on a very large database having abt more than 4lakh records in one table. iam using sqlserver 2000. i wrote a program which fetches all the records in that table and prints in the browser.the problem is when i run it after sometime it gives an error mesg like "Fatal error: Maximum execution time of 30 seconds exceeded in c:\phpWeb\name.php on line 21" . it will print only few record.approximately 50 thousand.
what should i do to print all my records.
this error may be because it is taking more time.
pls some one help me to solve my problem.
thank u.




Sponsored Link
Ads by Google

Response Number 1
Name: Don Arnett
Date: December 8, 2004 at 10:17:58 Pacific
Reply:

How many is 41akh records?

too much time, too much memory, same solution:

The browser has only a finite amount of memory available to it, so there is a limit to the about of code (HTML, Javascript, etc) and data that it can hold. Plus, who wants to browse down thru 50000 records.

You'll have to change the code to display groups of records. I once had a system that had 2000 records sorted by name. I wrote code to display a menu that broke the names into groups

Arnett - Baker
Bakers - Cornwall
Cornwell - Evers
Eyers - Zimbo

The user picked one of the options and then those names were displayed.

The point is, you'll need to somehow divide your data into subgroups and display one subgroup at a time.

Be sure to come back and let us know if our suggestions helped!


0

Response Number 2
Name: sunny
Date: December 8, 2004 at 22:51:50 Pacific
Reply:

sorry its 4 Lakh records (rows).
thank u for the reply. but the error it gave is abt the execution time 'exceeding 30 sec'.
can u tell me why it gave this error.
is there any way i view all my records at one time ( i mean in one run) ?
thank u.


0

Response Number 3
Name: SN
Date: December 9, 2004 at 08:29:25 Pacific
Reply:

Apparently a lakh is a hundred thousand. You learn something new every day :-)

set-time-limit function

max-execution-time php.ini setting

-SN


0

Response Number 4
Name: Don Arnett
Date: December 9, 2004 at 08:44:12 Pacific
Reply:

I wonder why Sunny would assume that anyone knew that.

I still believe that Sunny will run into memory problems trying to display 50000 rows. Even if you were displaying only 1 char per row, by the time you add in a
per row, you are using 250k for a page. I don't think the browser will handle that.

Be sure to come back and let us know if our suggestions helped!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: PHP error

unexpected T_FOREACH - PHP ERROR www.computing.net/answers/programming/unexpected-tforeach-php-error/15899.html

PHP error on page and Can't figure it out www.computing.net/answers/programming/php-error-on-page-and-cant-figure-it-out/19250.html

CGI error.... with php!!?? www.computing.net/answers/programming/cgi-error-with-php/470.html