Re: How do i replace table names?
| From: | Bas | Date: | Mon, 03 Nov 2003 15:11:17 +0000 |
| Subject: | Re: How do i replace table names? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-168391@lists.php.net to get a copy of this message | ||
No, i mean to replace the names in the string... And then execute them...
"Jay Blanchard" <jay.blanchard@niicommunications.com> wrote in message
news:C8F323573C030A448F3E5A2B6FE2070B01AFA9F7@nemesis...
[snip]
I want to replace something like this:
$sql = "CREATE TABLE bas_table (
)";
With this:
"CREATE TABLE hugo_table (
)";
And do the same for INSERT INTO... How do i do this?
[/snip]
Top of the morning to you Bas!
I have a couple of questions for you.
1. Have you read <em>any</em> of the manual?
2. Are you subscribed to the MySQL list?
All queries are run in the same way. If you have permissions in the
database you can do this (for example);
$sqlInsert = "INSERT INTO tableBAS (php, mysql) ":
$sqlInsert .= "VALUES ('knowledge from having read PHP manual', ";
$sqlInsert .= "'knowledge from having read MySQL manual') ";
$dbInsert = mysql_query($sqlInsert, $connectionInformation);
HTH!