Code Comments
Programming Forum and web based access to our favorite programming groups.I have checked my logfiles, and everything seems to be running
smoothly and error free=2E The truncation occurs wether I use the
odbc=5Fresult=5Fall function or something like:
WHILE( odbc=5Ffetch=5Frow( $CallTest ) ):
=09FOR( $ii =3D 1; $ii <=3D odbc=5Fnum=5Ffields( $CallTest ); ++$ii ):
=09=09PRINT (odbc=5Ffield=5Fname( $CallTest, $ii ) =2E" =3D "=2E odbc=5Fre=
sult(
$CallTest, odbc=5Ffield=5Fname( $CallTest, $ii ) ) =2E "<br>");
=09ENDFOR;
=09PRINT ("<br><br>");
ENDWHILE;
So it is not a problem with odbc=5Fresult=5Fall=2E I have compared the
source of the resulting page with the output buffering generated file
and it is definitely truncating, no <-- or <span display=3D"none"> or
anything similar=2E=2E=2E In one case, the browser page source was 12,196
characters in length compared to 37,127 characters in the output
buffer file=2E=20
As you said, there are some 'hackish' things that I have tried such
as tacking on several thousand characters of whitespace to the end of
the output, which still truncates, but ends up truncating in the
middle of the whitespace=2E=2E=2E I refuse to resort to something like
this=2E
The parameters for mladselmeans=3F nothing too fancy, just passing it a
bunch of minimum and maximum values for various lookups and
calculations that the CALLed statement does=2E=2E=2E
Anthony Robins
---- Original Message ----
From: martin=2Enorland@stjude=2Eorg
To: php-db@lists=2Ephp=2Enet
Subject: Re: [PHP-DB] Sybase CALL statement problems
Date: Tue, 29 Mar 2005 09:33:53 -0600
>Anthony Robins wrote:
>a
> odbc=5Fconnect($DataSourceName,$DataSour
ceUserID,$DataSourcePassword);
>99999999,
>is
e
>of
>
>A number of possibilities come to mind - some hackish unfortunately=2E=20=
>You say with output buffering the contents make it into the file,
>but=20
>not the web browser=2E Have you checked your logfiles to see if there
>is=20
>anything - perhaps the script is terminating early, etc=2E Print=20
>something after the table as well, see if that doesn't help=2E It=20
>certainly sounds like something is being buffered=2E There are reports
>
>that this function doesn't return the total number of rows correctly,
>
>but nothing more on that as to whether that indicates a problem or
>not=2E
>
>http://www=2Ephp=2Enet/manual/en/fu...esult-all=2Ephp
>
>Also - you may want to view the source, or open that output buffering
>
>generated file in a web browser - and see if the same problem
>persists=2E=20
> It could just be bad data inside the database that's causing for
>e=2Eg=2E=20
><!-- or <span display=3D"none"> or who knows what - to make it *appear*
>
>that the content is truncated=2E
>
>Obviously - you could try something hackish where you output buffer
>to a=20
>file, then emit the file to the browser - but if its all getting into
>
>the file I'd say the problem lies elsewhere, and that *shouldn't*
>work=20
>anyway, or if it does it's just a buffering problem in the first
>place=2E
>
>definitely check all logs=2E twice=2E
>
>Incidentally, what is with the parameters to mladselmeans - it looks=20
>very strange :)
>
>cheers,
>--=20
>- Martin Norland, Sys Admin / Database / Web Developer, International
>
>Outreach x3257
>The opinion(s) contained within this email do not necessarily
>represent=20
>those of St=2E Jude Children's Research Hospital=2E
>
>--=20
>PHP Database Mailing List (http://www=2Ephp=2Enet/)
>To unsubscribe, visit: http://www=2Ephp=2Enet/unsub=2Ephp
>
Post Follow-up to this messageAnthony Robins wrote:
> I have checked my logfiles, and everything seems to be running
> smoothly and error free. The truncation occurs wether I use the
> odbc_result_all function or something like:
>
> WHILE( odbc_fetch_row( $CallTest ) ):
> FOR( $ii = 1; $ii <= odbc_num_fields( $CallTest ); ++$ii ):
> PRINT (odbc_field_name( $CallTest, $ii ) ." = ". odbc_result(
> $CallTest, odbc_field_name( $CallTest, $ii ) ) . "<br>");
> ENDFOR;
> PRINT ("<br><br>");
> ENDWHILE;
>
> So it is not a problem with odbc_result_all. I have compared the
> source of the resulting page with the output buffering generated file
> and it is definitely truncating, no <-- or <span display="none"> or
> anything similar... In one case, the browser page source was 12,196
> characters in length compared to 37,127 characters in the output
> buffer file.
>
> As you said, there are some 'hackish' things that I have tried such
> as tacking on several thousand characters of whitespace to the end of
> the output, which still truncates, but ends up truncating in the
> middle of the whitespace... I refuse to resort to something like
> this.
[snip]
(silly question) a flush() does nothing? You could also try turning on
output buffering, and then just ob_flush()'ing when done (and turn it
back off). http://www.php.net/manual/en/function.flush.php mentions
some caveats (specifically - some that may apply to you - w32 servers,
and mod_gzip). The fact that adding whitespace 'helps' really screams
it's a buffering problem IMO.
http://www.php.net/odbc_longreadlen mentions truncation, but it's
talking about TEXT/BLOB and the likes, since you *can* get the full
results, I doubt this is meaningful.
Cheers,
--
- Martin Norland, Sys Admin / Database / Web Developer, International
Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.