Re: rtrim

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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 <jlarson@xxxxxxxxxxxxxx>:  
  
> 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?   
>   
>   
  
  


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux