Hi There,
I'm using MySQL with PHP and am trying to alter a table. I need to insert a column into a table. I copied to an example from the MySQL docs however I got an error. I'm not sure if my permissions are set right or if I am screwing up.
Could someone please post a sample alter statement to add a new column to a table after a specific existing column (say "food").
Thanks,
-Dico
alter table food add smell int unsigned not null;
alter table mytable add column new_col int(10) not_null after food;
Printing the mysql error usually tells you just what is wrong with your query.
do something like this:
if ($result=mysql_query("your_query_here")) {
} else {
echo mysql_errno().": ".mysql_error()."<BR>"; };