Re: [PHP-DB] Updating multilple tables?

2003-11-27 Thread Ignatius Reilly
In MySQL:
UPDATE mytable
SETmycol = REPLACE( mycol, $replacee, $replaceor )

All you have to do is provide the loop some structure so that it can find
the column to process
eg an array( "table" => array( "column1", ... ) ) or even better another
table.

Ignatius
_
- Original Message -
From: <[EMAIL PROTECTED]>
To: "Ignatius Reilly" <[EMAIL PROTECTED]>
Cc: "PHP DB list" <[EMAIL PROTECTED]>
Sent: Thursday, November 27, 2003 16:02
Subject: Re: [PHP-DB] Updating multilple tables?


> All good,
> I've got a loop based on all my tables... (cheers for that)
> however, I still wanna look within an entry for a smaller entry..
>
> EG:
> "the quick brown frog jumped over the lazy dog"
> I want to find and repace "frog" with "fox" but do this happens with text
> all over my database.
>
> I'll get there...! ;-)
>
>
>
>
>
>
>
> "Ignatius Reilly" <[EMAIL PROTECTED]>
> 27/11/2003 15:02
>
> To
> "PHP DB list" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> cc
>
> Subject
> Re: [PHP-DB] Updating multilple tables?
>
>
>
>
>
>
> One possible reason you did not google back anything is that what you are
> asking can't be done in SQL.
> In SQL you can update only one table at a time.
>
> Why not write a PHP function that does the job successively on each table?
>
> To list tables in MySQL: SHOW TABLES FROM 
>
> HTH
> Ignatius
> _
> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: "PHP DB list" <[EMAIL PROTECTED]>
> Sent: Thursday, November 27, 2003 15:31
> Subject: [PHP-DB] Updating multilple tables?
>
>
> > 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...?
> >
> > *
> > The information contained in this e-mail message is intended only for
> > the personal and confidential use of the recipient(s) named above.
> > If the reader of this message is not the intended recipient or an agent
> > responsible for delivering it to the intended recipient, you are hereby
> > notified that you have received this document in error and that any
> > review, dissemination, distribution, or copying of this message is
> > strictly prohibited. If you have received this communication in error,
> > please notify us immediately by e-mail, and delete the original message.
> > ***
> >
> >
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> *
> The information contained in this e-mail message is intended only for
> the personal and confidential use of the recipient(s) named above.
> If the reader of this message is not the intended recipient or an agent
> responsible for delivering it to the intended recipient, you are hereby
> notified that you have received this document in error and that any
> review, dissemination, distribution, or copying of this message is
> strictly prohibited. If you have received this communication in error,
> please notify us immediately by e-mail, and delete the original message.
> ***
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Updating multilple tables?

2003-11-27 Thread Tristan . Pretty
All good,
I've got a loop based on all my tables... (cheers for that)
however, I still wanna look within an entry for a smaller entry..

EG:
"the quick brown frog jumped over the lazy dog"
I want to find and repace "frog" with "fox" but do this happens with text 
all over my database.

I'll get there...! ;-)







"Ignatius Reilly" <[EMAIL PROTECTED]> 
27/11/2003 15:02

To
"PHP DB list" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
cc

Subject
Re: [PHP-DB] Updating multilple tables?






One possible reason you did not google back anything is that what you are
asking can't be done in SQL.
In SQL you can update only one table at a time.

Why not write a PHP function that does the job successively on each table?

To list tables in MySQL: SHOW TABLES FROM 

HTH
Ignatius
_
- Original Message -
From: <[EMAIL PROTECTED]>
To: "PHP DB list" <[EMAIL PROTECTED]>
Sent: Thursday, November 27, 2003 15:31
Subject: [PHP-DB] Updating multilple tables?


> 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...?
>
> *
> The information contained in this e-mail message is intended only for
> the personal and confidential use of the recipient(s) named above.
> If the reader of this message is not the intended recipient or an agent
> responsible for delivering it to the intended recipient, you are hereby
> notified that you have received this document in error and that any
> review, dissemination, distribution, or copying of this message is
> strictly prohibited. If you have received this communication in error,
> please notify us immediately by e-mail, and delete the original message.
> ***
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



Re: [PHP-DB] Updating multilple tables?

2003-11-27 Thread Ignatius Reilly
One possible reason you did not google back anything is that what you are
asking can't be done in SQL.
In SQL you can update only one table at a time.

Why not write a PHP function that does the job successively on each table?

To list tables in MySQL: SHOW TABLES FROM 

HTH
Ignatius
_
- Original Message -
From: <[EMAIL PROTECTED]>
To: "PHP DB list" <[EMAIL PROTECTED]>
Sent: Thursday, November 27, 2003 15:31
Subject: [PHP-DB] Updating multilple tables?


> 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...?
>
> *
> The information contained in this e-mail message is intended only for
> the personal and confidential use of the recipient(s) named above.
> If the reader of this message is not the intended recipient or an agent
> responsible for delivering it to the intended recipient, you are hereby
> notified that you have received this document in error and that any
> review, dissemination, distribution, or copying of this message is
> strictly prohibited. If you have received this communication in error,
> please notify us immediately by e-mail, and delete the original message.
> ***
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Updating multilple tables?

2003-11-27 Thread Miles Thompson
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 +, [EMAIL PROTECTED] 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...?
 

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php