Re: Updating multilple tables?
| From: | Miles Thompson | Date: | Thu, 27 Nov 2003 14:51:59 +0000 |
| Subject: | Re: Updating multilple tables? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-31792@lists.php.net to get a copy of this message | ||
If you are searching in the same field (column) in each table, and the key field has the same name in all tables, build an array of table names and loop through it, executing your update on each iteration.
Regards - Miles Thompson
PS From your description it sounds as if you have a database design problem - common blocks of text are normally stored in some type of lookup table.
At 02:31 PM 11/27/2003 +0000, Tristan.Pretty@risk.sungard.com wrote:
I have scattered around about 100 tables a block of text... I wasn to serach through ALL my tables, and ALL my rows for this text, adn repalce it with another block of text. I've searched n google for "mysql multiple table update" But have yet to find an answer.. anyone know an easy way to do this? All the tables are on the same database, so I just need to say, search ALL tables within database Tris...? <long conditional snipped>