Skip to Content.
Sympa Menu

freetds - Re: PHP's mssql_fetch_row inserting '\0' on strings ?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT ais.org>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Cc: <brblueser AT uol.com.br>, <LowdenJK AT bernstein.com>
  • Subject: Re: PHP's mssql_fetch_row inserting '\0' on strings ?
  • Date: Wed, 19 Jun 2002 20:03:52 -0400 (EDT)



pedantic note, it would be --with-sybase or --with-sybase-ct for dblib and
ctlib respectively. You can see how it was built by checking the
config.status file.

The sybase module(s) in PHP where built with sybase in mind (duh) and not
necessarily with TDS 7.0 feature such as nvarchars. So while I'd usually
suspect FreeTDS over PHP (PHP is a more mature code base than FreeTDS, and
gets more "eyeballs" looking at it), in this case the problem could be in
either camp. A good way to tell (though not definitive) is if both APIs
(dblib, ctlib) run into the problem or not.

Part of the problem is that PHP does not simply store strings as null
terminated arrays (otherwise, what was beyond the first null would be
irrelevant). I'm going to take a wild guess that the size of the
resultant data (with all those nulls) is twice the size of the data?

If so, dbdatlen() or it's ctlib counterpart (length bind) is a possible
culprit in FreeTDS, but we need a bit more info.

Brian

> > ... I must confess I don't know how to answer your question ={ How do I
> > check that?
>
> I don't know how to check, except to know how your PHP was put together.
> Per our UG, http://www.freetds.org/userguide/x1076.htm did you do your
> ./configure --with-sybase
> or
> ./configure --with-iodbc=/usr/local
>
> and, if --with-sybase, did you link to the ct or db libraries?
>
> Regards,
>
> --jkl
>






Archive powered by MHonArc 2.6.24.

Top of Page