Posts: 175
Location: Wiltshire, England
|
Quote:
Originally Posted by ForrestCroce
Ah, but how do you know which table and which column?
|
In the query "UPDATE table SET column = REPLACE(column, ";"," ")"
table is the name of the table you want to update and column is the name of the column in that table. Let's say I had a table called users and wanted to change entries in the column called address, the query would be: -
UPDATE users SET address = REPLACE(address, ";", " ")
Moving on, it is just as easy (if not easier) to get a list of tables from a given database with the following query:
SHOW TABLES FROM db_name;
and a list of columns from a given table:
SHOW COLUMNS FROM tbl_name;
Likewise, one could iterate throughout and perform multiple updates if required
Hope this adds something for someone
Ian
__________________
Found this useful? - HIT MY TALKUPATION!
Please login or register to view this content. Registration is FREE
|