Need update query--Remove the coma ","

Reply

Join Date: Jul 2006
Posts: 197
Reputation: vssp has a little shameless behaviour in the past 
Solved Threads: 5
vssp vssp is offline Offline
Junior Poster

Need update query--Remove the coma ","

 
0
  #1
Aug 10th, 2006
Hi friends

Thanks for your repaly for all my question..
I need one update query. I have selected the datas are insert with coma ",".

Query
SELECT city
FROM `locations`
WHERE city REGEXP ','

I got the result..
Silver Spring,
Elkins,
PORTLAND,
Baltimore,

I need like this
Silver Spring
Elkins
PORTLAND
Baltimore

I need to remove the "," and restore the values .
Thanks
Vssp
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 494
Reputation: Puckdropper is an unknown quantity at this point 
Solved Threads: 21
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: Need update query--Remove the coma ","

 
0
  #2
Aug 10th, 2006
That's really more of an SQL thing. You may want to try posting there if you don't find your answer here.

It can be done in PHP, probably not as fast, though.
Run your query, parse the result set (Take a look at http://us2.php.net/manual/en/function.stripos.php) and write the update query.
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 197
Reputation: vssp has a little shameless behaviour in the past 
Solved Threads: 5
vssp vssp is offline Offline
Junior Poster

Re: Need update query--Remove the coma ","

 
0
  #3
Aug 10th, 2006
Hi thanks for your replay
This is the update query

UPDATE `locations` SET city = replace( city, ',', '' ) WHERE city LIKE '%,'

I just share with u


Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 139
Reputation: aarya is an unknown quantity at this point 
Solved Threads: 0
aarya's Avatar
aarya aarya is offline Offline
Junior Poster

Re: Need update query--Remove the coma ","

 
0
  #4
Aug 16th, 2006
I THINK YIU CAN USE str_replace
increase youe site traffic

http://www.articleboards.com

Running free html asp php jsp xml xhtml j2ee mysql tutorials

http://www.freewebschools.com

Submit your design portfolio and increase your popularity

http://designers-portfolio.com
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC