MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old July 15th, 2004, 11:56 AM
talen152 talen152 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 6 talen152 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 53 sec
Reputation Power: 0
Arrow updating fields in database. syntax help

Hi, I have a database I recently imported from a linux machine.
THis databse has a table named images, where a field pathname exists.

The pathname is currently under the linux directory structure. It is also very strange because
mysql decided to concat c:/documents and settings/my pictures to all the pathname values...

So what I need is to remove that part of the string ("c:/documents and settings/my pictures") and replace it with
"c:/www/apache2/"

How would I go about doing this? I'm just having problems removing the substring. I can concat "c:/www/apache2/" without any problems.

Thanks,,

Itamar Levin

Reply With Quote
  #2  
Old July 15th, 2004, 12:42 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
The following example should get you on the right path:

Code:
mysql> select * from strings;
+-------------------------+
| val                     |
+-------------------------+
| one two three four five |
+-------------------------+
1 row in set (0.00 sec)
 
mysql> select SUBSTRING(val, 5, 10) from strings;
+-----------------------+
| SUBSTRING(val, 5, 10) |
+-----------------------+
| two three             |
+-----------------------+
1 row in set (0.00 sec)
 
mysql> update strings set val=SUBSTRING(val,5,10);
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0
 
mysql> select * from strings;
+-----------+
| val       |
+-----------+
| two three |
+-----------+
1 row in set (0.00 sec)
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > updating fields in database. syntax help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway