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] I want to replace something like this: $sql = "CREATE TABLE bas_table ( )"; With this: "CREATE TABLE hugo_table ( )&...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
[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! |
|
|||
|
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@neme sis... [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! |