Quote:
Originally Posted by Sinner
To set a default value:
PHP код:
ALTER TABLE `table_name` CHANGE `column_name` `column_name` TYPE DEFAULT `default_value`;
So, for example, you want "score" to be set to 0 on default nd the table is called "users", you need to do:
PHP код:
ALTER TABLE `users` CHANGE COLUMN `score` `score` INT DEFAULT 0;
|
When you insert a new row, if you don't set the columns that are integers it will automatically set them to 0