Thread: AOLServer/PHP/PostGres Site...
I haven't a problem that I'm sure isn't related to postgres, but I've gotten good answers here before and no one seems to be answering/have a solution for me on the php lists, so if you're a php or html guru please read on, otherwise I apologize for bothering you. I have a page being created using php and a backend postgres database. The page is a series of tables. Each table has five rows, each row has five columns, three of which are forms with about four hidden variables and a submit button. The hidden variables are combinations of values from the database and extracts of SQL where clauses used to further restrict a search. There are about 60 rows divided up among the tables (using multiple tables to allow for incremental loading). About 2/3 of the way through, one of the tables (which one depends on the amount of debugging echo's in the code) gets corrupted and a row is truncated, causing the next row to start within a preceding row. The variable containing the row to print is correct and will print to a file correctly. Somewhere between the php echo statement and the browser the line gets truncated. The line is no longer or shorter than the other lines around it that made it through fine. The code works on an apache server running on a machine with 128 MB ram (the AOLServer machine has 64 MB ram). The page itself is about 80Kb because of all the hidden fields in the forms. I know this is outside the scope of this list, but does anyone have any ideas about what could be causing this? Eric Nielsen
Just a shot or two in the dark... Running out of room in buffers? Try writing to a local temp file and then using filepassthru() (don't have the manual in front of me) to send it to the browser. Try also freeing your pg result sets as soon as you're done with them. I was going to suggest embedded '>' and '<' characters, but if the page works fine in Apache, then that's probably not it... Here's hoping someone has a better answer. Ciao --Louis <louis@bertrandtech.on.ca> On Wed, 7 Mar 2001, Eric Nielsen wrote: > I haven't a problem that I'm sure isn't related to postgres, but I've gotten > good answers here before and no one seems to be answering/have a solution > for me on the php lists, so if you're a php or html guru please read on, > otherwise I apologize for bothering you. > > I have a page being created using php and a backend postgres database. The > page is a series of tables. Each table has five rows, each row has five > columns, three of which are forms with about four hidden variables and a > submit button. The hidden variables are combinations of values from the > database and extracts of SQL where clauses used to further restrict a > search. There are about 60 rows divided up among the tables (using multiple > tables to allow for incremental loading). About 2/3 of the way through, one > of the tables (which one depends on the amount of debugging echo's in the > code) gets corrupted and a row is truncated, causing the next row to start > within a preceding row. The variable containing the row to print is correct > and will print to a file correctly. Somewhere between the php echo > statement and the browser the line gets truncated. The line is no longer or > shorter than the other lines around it that made it through fine. > > The code works on an apache server running on a machine with 128 MB ram (the > AOLServer machine has 64 MB ram). The page itself is about 80Kb because of > all the hidden fields in the forms. > > I know this is outside the scope of this list, but does anyone have any > ideas about what could be causing this? > > Eric Nielsen > > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >
"Eric Nielsen" <ericnielsen@earthlink.net> writes: > About 2/3 of the way through, one > of the tables (which one depends on the amount of debugging echo's in the > code) gets corrupted and a row is truncated, causing the next row to start > within a preceding row. The variable containing the row to print is correct > and will print to a file correctly. Somewhere between the php echo > statement and the browser the line gets truncated. The line is no longer or > shorter than the other lines around it that made it through fine. > The code works on an apache server running on a machine with 128 MB ram (the > AOLServer machine has 64 MB ram). The page itself is about 80Kb because of > all the hidden fields in the forms. Hm. Does the truncation happen to occur near the 64Kb mark in the page contents? If so, that'd suggest buffer overrun somewhere in PHP (since 64K would be a pretty likely choice for a buffer size). > I know this is outside the scope of this list, Yeah, I'm afraid this is pretty far off-topic for Postgres. I suggest going back to rag on the PHP people some more. I rather suspect that you'll find the problem is reproducible without Postgres, if you just make up a script that echoes the same total volume of data... regards, tom lane