Frank,

Here's some additional info. The following code snippet does the following:


-----Original Message-----
From: Frank M. Kromann [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 9:56 PM
To: Flint Doungchak
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Required to Trim Variables with MSSQL Module


Hi Flint,

Unless we have a bug in the MSSQL extension it is supposed to function in
one of two ways depending on the setting of mssql.compatability_mode in
php.ini:

mssql.compatability_mode = off
Columns are returned according to the type defined in the database. integers
of anty size becomes a LONG, char, varchar and text becomes a STRING etc.

mssql.compatability_mode = on
All column are returned as strings no matter how they are defined in the
database.

No matter what mode you are using trailing spaces will be removed from any
STRING values. Leading spaces will not be removed !

- Frank



> Hi all, 
> 
> I've got a rather iritating problem. I recently moved a site from PHP
3.0.11
> to 4.0.5 RC1. It seems, and I have noticed this for a while in other
> scripts, that variables returned from MSSQL sometimes need to be trimmed
> with trim() in order to function correctly.
> 
> Sometimes they won't evaluate as integers (i.e. they don't add right),
other
> times they don't evaluate right as strings (i.e. with if (!$row[crap]),
and
> other times if I have a header redirect (i.e. Header("Location:
> ./index.php?crap=$row[crap]") ) I get the infamous CGI header problem. 
> 
> I generally retrieve with $row = mssql_fetch_array($result);
> 
> In all cases adding trim will fix the problem. Anyone had similar
problems.
> Am I missing something. This seems to be odd behavior. I really don't want
> to go through all my scripts and trip stuff.
> 
> Thanks,
> 
> -Flint
> 
> 
> 
> -- 
> PHP Windows 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 Windows 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]

Reply via email to