Re: [PHP-DB] extra spaces

From: Miles Thompson <milesthompson(at)sprint(dot)ca>
To: Soma Interesting <dfunct(at)telus(dot)net>
Cc: php-general(at)lists(dot)php(dot)net, php-db(at)lists(dot)php(dot)net, pgsql-general(at)postgresql(dot)org
Subject: Re: [PHP-DB] extra spaces
Date: 2000-12-16 02:59:09
Message-ID: 3A3ADA7D.9ECC9ED7@sprint.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

There's probably a trim() function in your database language. Use it in your select statement.

MySQL, for varchar fields, trims them automatically. Maybe it does it to char as well.

Miles Thompson

Soma Interesting wrote:

> I'm using PHP & PostgreSQL.
>
> All values called from the database are still padded with extra spaces from
> the column size in the database. Is this normal - I don't remember this
> happening when I was using MySQL. I thought usually the database stripped
> the extra spaces when it retrieved the values.
>
> How do you recommend dealing with this, using a PHP command to strip every
> value from the database - or can I change something in the database to have
> it strip the spaces auto magic like?
>
> - - - - - - -
> - - - -
> WARNING: Some experts believe that use of any keyboard may cause
> serious injury. Consult Users Guide.
> dfunct(at)telus(dot)net
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe(at)lists(dot)php(dot)net
> For additional commands, e-mail: php-db-help(at)lists(dot)php(dot)net
> To contact the list administrators, e-mail: php-list-admin(at)lists(dot)php(dot)net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Roland Roberts 2000-12-16 03:59:37 Re: extra spaces
Previous Message Robert B. Easter 2000-12-16 02:51:02 Re: question