I am trying to run the following mysql query, I am not getting any errors , but its also not working either?. I just want it to update the column name if a duplicate is detected. thanks :o)
<?php
$form_id = $_POST[form_id];
$query = mysql_query(<<<EOT
ALTER TABLE `email_history` ADD `$form_id` VARCHAR( 255 ) NOT NULL)
ON DUPLICATE KEY ALTER TABLE `email_history` CHANGE `$form_id` `$form_id` VARCHAR( 255 ) NOT NULL
EOT
) or die(mysql_error());
?>
Edit >>>>>>> The only reason I was trying to update was so that the script doesn't error when the form is edited. What is supposed to do is when the email template is created, it adds a column to the email history table, when a user sends an email using the template a date is recorded under that column. The problem occurs when the email template is edited as the create column script tries to re create the column for the template in email history and I get an error, ideally when edited the template would just see that the column already existed and did not try to re create it.