Webmaster Forums Banner Professional Hosting from Just Host
Welcome Guest Search | Active Topics | Members | Log In | Register

updating in MySQL Options
manzor
Posted: Thursday, June 12, 2008 11:21:09 AM
Rank: Advanced Member
Groups: Member

Joined: 1/31/2008
Posts: 32
Points: 96
Location: UK
hi guys

i 'm having problem in searching and replacing text in specific field. well i know about mysql update command and have lookup up regexp but not solved. typical data is : abcQFxyz to chnage to abcQFIxyz.

I got as far as:
UPDATE mytable SET myfield = QFI WHERE part_number REGEXP 'QF';
but I know that wrong.

Thanks for your help.
Sponsor
Posted: Thursday, June 12, 2008 11:21:09 AM
sachin
Posted: Thursday, June 12, 2008 11:22:15 AM
Rank: Advanced Member
Groups: Member

Joined: 3/3/2008
Posts: 79
Points: 237
Location: India
manzor wrote:
hi guys

i 'm having problem in searching and replacing text in specific field. well i know about mysql update command and have lookup up regexp but not solved. typical data is : abcQFxyz to chnage to abcQFIxyz.

I got as far as:
UPDATE mytable SET myfield = QFI WHERE part_number REGEXP 'QF';
but I know that wrong.

Thanks for your help.


try this code

Code:
UPDATE `table_name` SET `field_name` = REPLACE(field_name, 'QF', 'GFI')
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

ASPNET Theme created by Boskone (Dan Ferguson)
Powered by HaqTech.Com
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.631 seconds.