User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 361,914 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,580 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1802 | Replies: 3
Reply
Join Date: Jul 2006
Posts: 173
Reputation: vssp is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 4
vssp vssp is offline Offline
Junior Poster

Solution Need update query--Remove the coma ","

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2004
Location: North East Indiana
Posts: 491
Reputation: Puckdropper is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 20
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

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

  #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  
Join Date: Jul 2006
Posts: 173
Reputation: vssp is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 4
vssp vssp is offline Offline
Junior Poster

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

  #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  
Join Date: Sep 2005
Posts: 139
Reputation: aarya is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
aarya's Avatar
aarya aarya is offline Offline
Junior Poster

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

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 9:54 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC