|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
renaming ,mysql table in php
I am trying to use my PHP script to rename a database table. I thought this would be the easiest part of my script, but I seem to be having a problem.
The script is mysql_connect("$userdbhost", "$userdbuser", "$userdbpass") or die ("Unable to connect to your database, please conact support@2techsolutions.com"); mysql_select_db("$userdbase") or die("Could not select database"); $renquery = "RENAME TABLE $tablelist TO $new_tbl_name"; $renresult = mysql_query($renquery); if (!$renresult) { $usrmsg = "<p align="left">Unable to rename your table from <b>$tablelist</b> to <b>$new_tbl_name</b>. Please contact<a href="mailto:support@2techsolutions.com" class="mainboxfont">support@2techsolutions.com</a> for further assistance.</p>n"; } // Do other stuff Any ideas? I am just getting the message telling me to contact support etc... |
|
#2
|
|||
|
|||
|
RE: renaming ,mysql table in php
change your query to
ALTER TABLE `$tablelist` RENAME `$new_tbl_name` |
|
#3
|
|||
|
|||
|
RE: renaming ,mysql table in php
I had to remove the quotes before it worked - thanks.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > renaming ,mysql table in php |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|