Re: Trimed results from PostgreSQL-Database

From: Date: Sun, 20 Aug 2000 21:38:28 +0000
Subject: Re: Trimed results from PostgreSQL-Database
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-12674@lists.php.net to get a copy of this message
Martin, Looks like you'll have to either trim(colname) or redefine your database and use varchar() type. The trim() isn't too bad, as you ususally set up a select statement and don't often change it. If you are building the statement dynamically you may have to do an "empty" fetch to get the returned fields, stick them in an array and then surround them with the trim(), rebuild your statement and eexecute it. Regards - Miles Thompson PS Your dismay echoes my own when I discovered this with dBase II! Martin Neimeier wrote: > Hello all, > > If i fetch a result-set from a PostgreSQL-table (using pg_Result, > pg_Fetch_Array, pg_Fetch_Object), all string-colums have trailing spaces > attached. > > Now the question: > > Is it posible to say the database, not to fill in trailing spaces ? If > yes how ? > (I dont want to use trim() on all columns !) > > cu > Martin > -- > -------------- > Martin Neimeier > Tel:+49(6262)912344 Fax:+49(6262)912347 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#12674) next »