[PHP-DB] Re: Pulling a long list of data stalls PHP

2002-01-08 Thread Peter Westergaard

Miles, you wrote:
 >Is your table indexed on the field your query is based on? That will
 >greatly speed up the query.
 >
 >Miles Thompson

I'm afraid in my case, the query needs to be pretty much a complete table dump.

Even if I filter a subset the data, my relational DB experience (not deep,
admittedly, and only with enterprise products like Oracle and ... ugh...
MSSql) tells me that indices on tables less than a few thousand entires
cost more in upkeep than they gain in response.  And this is only about 
300-400 rows... and more to the point, this happens when I pull more than 
30 of them or so!  I feel that something MUST be wrong!

But all of that aside, the problem isn't just that it takes a "long 
time"... the
problem seems to be that it literally *crashes* the instance of PHP! (The
webpage never finishes loading, and the CPU meter drops back down to idle
levels, and if I cancel the webpage, I leave an orphaned instance of
PHP.exe running, which I cannot kill even from my Win2000 Task Manager).

I mean, I'm a newbie and I'll admit that, but that just Don't seem Right.

Does ANYONE have any idea what might be happening and how I can fix it?
Please? :)

-P


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] RE: Pulling a long list of data stalls PHP

2002-01-09 Thread Max Sullivan



Just curious, but which version of PHP are you using, the ISAPI or CGI.
I've tried the isapi version before and had problems like this.  PHP
would crash and leave orphaned instances of php.  If your using the
isapi version try the cgi and see if it works for you.





-Original Message-
From: Peter Westergaard [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 08, 2002 6:39 PM
To: [EMAIL PROTECTED]
Subject: Re: Pulling a long list of data stalls PHP


Miles, you wrote:
 >Is your table indexed on the field your query is based on? That will
>greatly speed up the query.  >  >Miles Thompson

I'm afraid in my case, the query needs to be pretty much a complete
table dump.

Even if I filter a subset the data, my relational DB experience (not
deep, admittedly, and only with enterprise products like Oracle and ...
ugh...
MSSql) tells me that indices on tables less than a few thousand entires
cost more in upkeep than they gain in response.  And this is only about 
300-400 rows... and more to the point, this happens when I pull more
than 
30 of them or so!  I feel that something MUST be wrong!

But all of that aside, the problem isn't just that it takes a "long 
time"... the
problem seems to be that it literally *crashes* the instance of PHP!
(The webpage never finishes loading, and the CPU meter drops back down
to idle levels, and if I cancel the webpage, I leave an orphaned
instance of PHP.exe running, which I cannot kill even from my Win2000
Task Manager).

I mean, I'm a newbie and I'll admit that, but that just Don't seem
Right.

Does ANYONE have any idea what might be happening and how I can fix it?
Please? :)

-P



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Pulling a long list of data stalls PHP

2002-01-09 Thread Ian Ferger


try mysql_fetch_array... mysql_fetch_row is a crappy old function.

- Original Message -
From: "Peter Westergaard" <[EMAIL PROTECTED]>
Newsgroups: php.db
To: <[EMAIL PROTECTED]>
Sent: Monday, January 07, 2002 8:32 AM
Subject: Pulling a long list of data stalls PHP


> Hi,
>
> I'm attempting to pull about 300 rows from a mysql database, (all rows in
> the table).
> I can pull the first 10, the first 20, the first 30, no problem.  (using
> LIMIT (start), (10|20|30)... in the SQL statement)
>
> But if I attempt to pull all of them (no LIMIT clause), or even the first
> (x) where (x) is much more than 30, using a simple while
> (mysql_fetch_row($sql,$db))... construction, IE just idles, tells me it is
> loading the page, and never displays anything.   When I press "STOP", I
> have a hung PHP process in my Task Manager, which I cannot kill!
>
> Does anyone know what could cause this behaviour?  It seems so simple,
what
> I'm trying to do, that I'm going insane.
> Very frustrated.
>
> Please, someone help a poor newbie out!
> -P
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] RE: Pulling a long list of data stalls PHP

2002-01-10 Thread Peter Westergaard

At 08:03 AM 1/9/2002 -0800, Max wrote:


>Just curious, but which version of PHP are you using, the ISAPI or CGI.
>I've tried the isapi version before and had problems like this.  PHP
>would crash and leave orphaned instances of php.  If your using the
>isapi version try the cgi and see if it works for you.

Actually, this was using the CGI version.  I haven't had a single problem 
since I went back to php-ini-dist.  Lightning fast response too.
Anyone know what setting might have caused the weirdness?  Someday I'll go 
through and figure it out.

-P


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Re: Pulling a long list of data stalls PHP

2002-01-08 Thread Miles Thompson

Peter,

That's not right, but please forgive me if there is some background I've 
misplaced and I'm asking "old" questions.

What OS are you on?

What database? (I'm assuming MySQL, just because it's so common.)

What version of the database?

What version of PHP?

Can you execute your SELECT at the database console and get  a fast 
response? (I think so, if I correctly remember an earlier post.)

Are you testing on the same machine PHP/Web Server/database is on? Across a 
LAN? Across Internet?

How big a set of data are you returning?  (# records) * (bytes/record)

This is a long shot, and I'm only making it on the SWAG that you are 
running on Windows. There are 2 versions of the PHP.INI file. Somewhere on 
this list I read that someone was using the "optimized" version and was 
having a lot of trouble. After switching to the other one the problems went 
away.

I've not used PHP on Windows, but this is essentially a diagnostic 
procedure, so it's worth working through.

Miles Thompson

PS I've read the other message too, just chose this one to reply to.
(It's 11:00 PM here in NS, and I want to go to bed. Tomorrow I have to go 
out early, but I will check your reply later.)

At 09:38 PM 1/8/2002 -0500, Peter Westergaard wrote:
>Miles, you wrote:
> >Is your table indexed on the field your query is based on? That will
> >greatly speed up the query.
> >
> >Miles Thompson
>
>I'm afraid in my case, the query needs to be pretty much a complete table 
>dump.
>
>Even if I filter a subset the data, my relational DB experience (not deep,
>admittedly, and only with enterprise products like Oracle and ... ugh...
>MSSql) tells me that indices on tables less than a few thousand entires
>cost more in upkeep than they gain in response.  And this is only about 
>300-400 rows... and more to the point, this happens when I pull more than 
>30 of them or so!  I feel that something MUST be wrong!
>
>But all of that aside, the problem isn't just that it takes a "long 
>time"... the
>problem seems to be that it literally *crashes* the instance of PHP! (The
>webpage never finishes loading, and the CPU meter drops back down to idle
>levels, and if I cancel the webpage, I leave an orphaned instance of
>PHP.exe running, which I cannot kill even from my Win2000 Task Manager).
>
>I mean, I'm a newbie and I'll admit that, but that just Don't seem Right.
>
>Does ANYONE have any idea what might be happening and how I can fix it?
>Please? :)
>
>-P
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Re: Pulling a long list of data stalls PHP

2002-01-08 Thread Miles Thompson

Something more ...

1. Put something like this in your code where you execute the query
$ result = mysql_queyr($sql) or die( mysql_errno()." : ".mysql_error());

2. If the query is succesful, just dump the result w/o any formatting, just 
in case the problem's there. (Shouldn't be with IE, it's remarkably tolerant.

3. When you view the source of the page in IE what do you see?  Does it 
look right?

4. There's always our old Windows standby -- reinstall the software! But 
let's not do that yet.

Miles

At 09:38 PM 1/8/2002 -0500, Peter Westergaard wrote:
>Miles, you wrote:
> >Is your table indexed on the field your query is based on? That will
> >greatly speed up the query.
> >
> >Miles Thompson
>
>I'm afraid in my case, the query needs to be pretty much a complete table 
>dump.
>
>Even if I filter a subset the data, my relational DB experience (not deep,
>admittedly, and only with enterprise products like Oracle and ... ugh...
>MSSql) tells me that indices on tables less than a few thousand entires
>cost more in upkeep than they gain in response.  And this is only about 
>300-400 rows... and more to the point, this happens when I pull more than 
>30 of them or so!  I feel that something MUST be wrong!
>
>But all of that aside, the problem isn't just that it takes a "long 
>time"... the
>problem seems to be that it literally *crashes* the instance of PHP! (The
>webpage never finishes loading, and the CPU meter drops back down to idle
>levels, and if I cancel the webpage, I leave an orphaned instance of
>PHP.exe running, which I cannot kill even from my Win2000 Task Manager).
>
>I mean, I'm a newbie and I'll admit that, but that just Don't seem Right.
>
>Does ANYONE have any idea what might be happening and how I can fix it?
>Please? :)
>
>-P
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Pulling a long list of data stalls PHP (SOLVED!)

2002-01-09 Thread Peter Westergaard

Thanks to Miles!

The problem, for anyone who is going through this themselves lay 
(in my case) with my php.ini file - evidently my fat fingers copied 
the 'recommended' php.ini file, instead of the 'distro' php.ini file.


The 'Recommended' file contains a few optimizations and security 
patches, recommended for a live-on-the-internet application.  I don't 
know what about that setup was incompatible with my application, 
but something was.  Maybe some day when I have a clue I'll figure 
it out.  

For now, I'm back up and running.  
Thanks, Miles.
-Peter 



===
EASY and FREE access to your email anywhere: http://Mailreader.com/
===



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Re: Pulling a long list of data stalls PHP [_SOLVED_]

2002-01-08 Thread Peter Westergaard

Thanks to Miles!

The problem, for anyone who is going through this themselves lay (in my 
case) with my php.ini file - evidently my fat fingers copied the 
'recommended' php.ini file, instead of the 'distro' php.ini file.

The 'Recommended' file contains a few optimizations and security patches, 
recommended for a live-on-the-internet application.  I don't know what 
about that setup was incompatible with my application, but something 
was.  Maybe some day when I have a clue I'll figure it out.

For now, I'm back up and running.
Thanks, Miles.
-Peter


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]