Jump to content

alter query - confused


pouncer

Recommended Posts

it's not working bud.

 

echo "ALTER TABLE `$cat` " . $data;

$c = mysql_query("ALTER TABLE `$cat` " . $data);

 

the echo gives me:

 

ALTER TABLE `movies` CHANGE `title` `title` , CHANGE `media` `media` , CHANGE `director` `directorsssss` , CHANGE `cast` `cast` , CHANGE `description` `description`

 

..but it's not changing the director field name to directorsssss

 

even this didn't work

mysql_query("ALTER TABLE movies CHANGE director hello");

 

Link to comment
https://forums.phpfreaks.com/topic/46184-alter-query-confused/#findComment-224546
Share on other sites

See if this query works,

 

$change = mysql_query("ALTER TABLE `movies` CHANGE `directors` `directorrrsss` VARCHAR( 100 ) NOT NULL");

 

 

If this doesnt work, I would just install phpMyAdmin ( Anytime you perform a command using their visual interface, it gives you the SQL Code, and has an option to output php formated code to use in your scripts )

Link to comment
https://forums.phpfreaks.com/topic/46184-alter-query-confused/#findComment-224557
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.