I need to change the default value for a mysql row from 0 to 1 for a thousand entries. What is the best way for me to do this?
If there are other values in the row that you don't want to change use this: mysql_query(UPDATE table_name SET row_name = '1' WHERE row_name = '0');
If you actually want to change the default value - that is, the value that goes into the field when an 'insert' is done that doesn't specify a value for that field, then you need to use ALTER TABLE. example: ALTER TABLE mytable MODIFY myfield INT NOT NULL DEFAULT 1; Code (markup):
i need to do both i need to alter the values already there and change it for any more incoming defualts