Skip to Content.
Sympa Menu

freetds - RE: [freetds] Empty string VS Space in select

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Empty string VS Space in select
  • Date: Tue, 21 Sep 2004 13:50:35 +0200

>
> I'm on PHP 4.3.8 + FreeTDS 0.61 (protocol 7.0) + MSSQL 2000
>

Try to enable log and if you can update FreeTDS.

> I already wrote about problem when inserting empty String in
> my database.
>
> I fact the true problem is during the select command (in my
> database the
> value is really empty).
> If the value of a column is empty, then returned result is ' '
>
> Any Idea ?
>
> $sql = "select UTI_NOM from UTILISATEUR ID_UTILISATEUR=10";

where is where ???
Try also "select UTI_NOM, LENGHT(UTI_NOM) as LEN from UTILISATEUR WHERE
ID_UTILISATEUR=10" there was a problem inserting data or using TDS 4.2...
perhaps you used 4.2 to insert data... how did you compile php to enable
mssql support ?

> $rs = mssql_query($sql);
> $row = @mssql_fetch_array($rs);
> echo $row["UTI_NOM"]; //write ' '
>

here try

echo "name=-{$row["UTI_NOM"]}- len={$row["LEN"]}";

>
>
> NB : please to note that I must use @ because if I have not
> result $rs is a
> true boolean instead of a ressource identifier
>
>
> Cédric
>

French it's really a useful language... I'm going to take some lessons next
month :)

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page