Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C8D9F475E3A for ; Wed, 22 Jan 2003 01:27:39 -0500 (EST) Received: from mail02.up.edu.ph (unknown [210.14.43.1]) by postgresql.org (Postfix) with SMTP id 8DBE9475D4B for ; Wed, 22 Jan 2003 01:27:38 -0500 (EST) Received: (qmail 31350 invoked by uid 504); 22 Jan 2003 06:59:37 -0000 Received: from ryanne.cruz@up.edu.ph by web2 with qmail-scanner-1.01 (update: v4243 15 Jan 2003. Clean. Processed in 1.442843 secs); 22 Jan 2003 06:59:37 -0000 Received: from unknown (HELO b01.mail.up.edu.ph) (10.16.3.1) by 10.16.3.144 with SMTP; 22 Jan 2003 06:59:35 -0000 Received: (qmail 26835 invoked by uid 504); 22 Jan 2003 06:31:11 -0000 Received: from ryanne.cruz@up.edu.ph by b01 with qmail-scanner-1.01 (update: v4243 15 Jan 2003. Clean. Processed in 0.51523 secs); 22 Jan 2003 06:31:11 -0000 Received: from unknown (HELO localhost) ([10.16.3.5]) (envelope-sender ) by 10.16.3.1 (qmail-ldap-1.03) with SMTP for ; 22 Jan 2003 06:31:11 -0000 Received: from 10.33.187.83 ( [10.33.187.83]) as user rocruz1@b04.mail.up.edu.ph by mail.up.edu.ph with HTTP; Wed, 22 Jan 2003 14:41:28 +0800 Message-ID: <1043217688.3e2e3d1880fb9@mail.up.edu.ph> Date: Wed, 22 Jan 2003 14:41:28 +0800 From: ryanne cruz To: "jlarson@candlefire.org" , pgsql-php@postgresql.org Subject: Re: rtrim References: <1043216728.3e2e39585c6f3@mail.up.edu.ph> <3E2E3872.9080901@candlefire.org> In-Reply-To: <3E2E3872.9080901@candlefire.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.1 X-Originating-IP: 10.33.187.83 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/36 X-Sequence-Number: 1781 Thanks Jason. but my data in that column varies. what i mean is that not all data ends in ", USA". some ends in ", Italy" or ", England". if i understood your code right, this only works when all my data ends with ", USA" or any country with 3 letters on it. anymore ideas? Quoting Jason k Larson : > rtrim and ltrim are used to remove whitespaces. I'm not certain why you > are getting unpredictable behavior, but try this instead. > > $column = substr ($column, 0, strlen($column)-5); // 5 = ', USA' > > http://www.php.net/manual/en/function.substr.php > > HTH, > Jason k Larson > > > ryanne cruz wrote: > > > > > hi list. > > > > if there's anyone here who's familiar with teh rtrim function, please > > i need > > help. > > > > i have a table that has a column in it that has data in this format: > > > > California, USA > > Nevada, USA > > . > > . > > . > > > > when i use rtrim to erase the ", USA" part, it only sometimes work. a > > sample > > result would be: > > > > California > > Nevad > > > > my query statement is: > > update table set name=rtrim(name,', USA'); > > > > why is it that it only works sometimes? > >