Bluehost.com Web Hosting $6.95

RE: [PHP] How do i replace table names?

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 ( )&...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-03-2003
Jay Blanchard
 
Posts: n/a
Default RE: [PHP] How do i replace table names?

[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!
Reply With Quote
  #2 (permalink)  
Old 11-03-2003
Bas
 
Posts: n/a
Default Re: [PHP] How do i replace table names?

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!
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 03:23 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0