I'd like to perform a global search and replace on MySQL database. I've checked with experts-exchange.com and the thread is below.
Any one at GT or forum that would warn me against doing this? My goal is to remove the words "Welcome to" from the titles of my links. Obviously, I'd back up EVERYTHING before hand. Thanks, April
I use MySQL from www.Gossamer-threads.com. It is basically a links directory.
I've got 5,000 links in the MySQL database.
The links can be "browsed" in alphabetical order.
So many of the links start with "Welcome to" in the Title.
I'd like to globally search and replace the entire database.
Is there a program that will do this?
Thanks, April
#################################################################
is it just one table?
if so...
update tblLinks set title = REPLACE(title, "Welcome to", "<replace with this string>")
#################################################################
yes, the database itsself is the program, that does things like that for you, as bobbit descibed.
the 4 basic sql-commands( this is the language to communicate with the database) are:
select, update, insert, delete.
select
-------
select -> gives you the data from 1 and more tables
select * from table1 where fieldc='test'
-> this way you all the records from table1 where fieldc='test'
update
---------
update -> lets you modify one ore more fields
update table1 set fielda='XXX' where fieldb='A'
-> this command sets in all records, which have in fieldb the entry 'A', the field fielda to 'XXX'
insert
---------
insert -> lets you insert a record(ore more) into a table
insert table1( fielda, fieldb ) values ( 'abc', 'def' )
-> this command inserts a record in table table1 with fielda='abc' and fieldb='def'
delete
---------
delete -> lets you delete a record(ore more) from a table
delete from table1 where fieldc='VV'
-> this command deletes all records in table1, which have in fieldc the entry 'VV'
hope to help :)
maik
A. Lougheed
IndyLinks.com
webmaster@indylinks.com
Any one at GT or forum that would warn me against doing this? My goal is to remove the words "Welcome to" from the titles of my links. Obviously, I'd back up EVERYTHING before hand. Thanks, April
I use MySQL from www.Gossamer-threads.com. It is basically a links directory.
I've got 5,000 links in the MySQL database.
The links can be "browsed" in alphabetical order.
So many of the links start with "Welcome to" in the Title.
I'd like to globally search and replace the entire database.
Is there a program that will do this?
Thanks, April
#################################################################
is it just one table?
if so...
update tblLinks set title = REPLACE(title, "Welcome to", "<replace with this string>")
#################################################################
yes, the database itsself is the program, that does things like that for you, as bobbit descibed.
the 4 basic sql-commands( this is the language to communicate with the database) are:
select, update, insert, delete.
select
-------
select -> gives you the data from 1 and more tables
select * from table1 where fieldc='test'
-> this way you all the records from table1 where fieldc='test'
update
---------
update -> lets you modify one ore more fields
update table1 set fielda='XXX' where fieldb='A'
-> this command sets in all records, which have in fieldb the entry 'A', the field fielda to 'XXX'
insert
---------
insert -> lets you insert a record(ore more) into a table
insert table1( fielda, fieldb ) values ( 'abc', 'def' )
-> this command inserts a record in table table1 with fielda='abc' and fieldb='def'
delete
---------
delete -> lets you delete a record(ore more) from a table
delete from table1 where fieldc='VV'
-> this command deletes all records in table1, which have in fieldc the entry 'VV'
hope to help :)
maik
A. Lougheed
IndyLinks.com
webmaster@indylinks.com