This is a discussion on RE: [PHP] How do i replace table names? within the PHP General forums, part of the PHP Programming Forums category; [snip] No, i mean to replace the names in the string... And then execute them... [snip] *slaps forehead* Duh, just ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
[snip]
No, i mean to replace the names in the string... And then execute them... [snip] *slaps forehead* Duh, just do it? $sqlCreateTable = "CREATE TABLE `dumBas` ( "; $sqlCreateTable .= "`ai` int(11) NOT NULL AUTO_INCREMENT, "; $sqlCreateTable .= "`thing` char(32) default NULL, "; $sqlCreateTable .= "`stuff` char(16) default NULL, "; $sqlCreateTable .= "PRIMARY KEY (`ai`), "; $sqlCreateTable .= "KEY `thing` (`thing`) "; $sqlCreateTable .= ") "; $dbCreateTable = mysql_query($sqlCreateTable, $connectionStuff); |
|
|||
|
OKAY, I WANT TO REPLACE IN THE TABLENAME THE TEXT BAS_ WITH DUMMY_
SUCH LIKE THAT "CREATE TABLE BAS_DATA" BECOMES "CREATE TABLE DUMMY_DATA" I AM NOT THAT DUMB... I JUST WANT TO REPLACE 1 TABLE PREFIX BY ANOTHER!!! "Jay Blanchard" <jay.blanchard@niicommunications.com> wrote in message news:C8F323573C030A448F3E5A2B6FE2070B01AFA9F9@neme sis... [snip] No, i mean to replace the names in the string... And then execute them... [snip] *slaps forehead* Duh, just do it? $sqlCreateTable = "CREATE TABLE `dumBas` ( "; $sqlCreateTable .= "`ai` int(11) NOT NULL AUTO_INCREMENT, "; $sqlCreateTable .= "`thing` char(32) default NULL, "; $sqlCreateTable .= "`stuff` char(16) default NULL, "; $sqlCreateTable .= "PRIMARY KEY (`ai`), "; $sqlCreateTable .= "KEY `thing` (`thing`) "; $sqlCreateTable .= ") "; $dbCreateTable = mysql_query($sqlCreateTable, $connectionStuff); |
|
|||
|
On Mon, Nov 03, 2003 at 04:37:41PM +0100, Bas wrote:
> OKAY, I WANT TO REPLACE IN THE TABLENAME THE TEXT BAS_ WITH DUMMY_ > > SUCH LIKE THAT "CREATE TABLE BAS_DATA" BECOMES "CREATE TABLE DUMMY_DATA" > > I AM NOT THAT DUMB... I JUST WANT TO REPLACE 1 TABLE PREFIX BY ANOTHER!!! sed -i.bak -e s'/BAS_/DUMMY_/g' your_sql_file.sql -- zhuravlev alexander u l s t u n o c |