Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mssql query - fixed length column pads with spaces

Status
Not open for further replies.

menkes

Programmer
Nov 18, 2002
47
0
0
US
Using PHP 4.3.9 results from a query DID NOT include spaces at the end of a fixed length column:

select fld from tbl where id = 1
assuming fld is varchar(12)
returns '12345'

I moved my site to a new server using PHP 5.2.8. No changes at all to the database. The same exact query now returns:
'12345 '

Please help...I cannot afford to have to go through all my code to fix this. It must be somewhere in PHP as the exact same database is being used.
 
OK, no need to respond to this. After much digging I found that the automatic trimming of return values was disabled in php_mssql long ago. So, unless someone is upgrading from a pre-2005 version (such as I was), this should not be an issue for anyone.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top