Jump to content

Query - ALTER TABLE


karimali831

Recommended Posts

Hi,

 

When I use the below query:

mysql_query("ALTER TABLE `".PREFIX."settings`
    ADD `col2` INT(11) NOT NULL default '1' AFTER `col1`,
    ADD `col3` varchar(255) NOT NULL default 'irc.evolu.net' AFTER `col2`;")
OR die(PREFIX.'settings failed');

 

It will die even though I have col2 but not col3 (column)

So lets say I have column col2 and not column col3, how can I change the query to that it will add column 3 only?

So basically add what I don't have and never mind the columns that are already there.

 

Thanks for help

Link to comment
https://forums.phpfreaks.com/topic/204668-query-alter-table/
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.