Re: Updating multilple tables?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In MySQL:
UPDATE mytable
SET    mycol = 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: <Tristan.Pretty@xxxxxxxxxxxxxxxx>
To: "Ignatius Reilly" <ignatius.reilly@xxxxxxx>
Cc: "PHP DB list" <php-db@xxxxxxxxxxxxx>
Sent: Thursday, November 27, 2003 16:02
Subject: Re:  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" <ignatius.reilly@xxxxxxx>
> 27/11/2003 15:02
>
> To
> "PHP DB list" <php-db@xxxxxxxxxxxxx>, <Tristan.Pretty@xxxxxxxxxxxxxxxx>
> cc
>
> Subject
> Re:  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 <database name>
>
> HTH
> Ignatius
> _________________________
> ----- Original Message -----
> From: <Tristan.Pretty@xxxxxxxxxxxxxxxx>
> To: "PHP DB list" <php-db@xxxxxxxxxxxxx>
> Sent: Thursday, November 27, 2003 15:31
> Subject:  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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux