Re: How do i replace table names?
| From: | Bas | Date: | Mon, 03 Nov 2003 15:37:41 +0000 |
| Subject: | Re: How do i replace table names? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-168395@lists.php.net to get a copy of this message | ||
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@nemesis...
[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);