sasori Posted August 24, 2008 Share Posted August 24, 2008 i got a problem doing a manual alteration of a column, whenever i tried to set a default value of 0 to a column which was presently set to NULL(e.g the cust_id primary key), it doesn't affect the column at all, aren't there any other way to set the default value to 0 manually? coz just like what i said it doesn't affect it manually, ??? Link to comment https://forums.phpfreaks.com/topic/121057-solved-set-default-help/ Share on other sites More sharing options...
centerwork Posted August 24, 2008 Share Posted August 24, 2008 One thing, your cust_id is set to auto_increment. That means that as soon as any new INSERT query is add mysql will automatically update cust_id to the next Auto ID. Thus leave the need for a default of 0 obsolete If you are manually setting cust_id then you need to remove auto_increment. This code might work for you. ALTER TABLE `customer` CHANGE `cust_id` `cust_id` INT( 32 ) NOT NULL DEFAULT '0' Link to comment https://forums.phpfreaks.com/topic/121057-solved-set-default-help/#findComment-624102 Share on other sites More sharing options...
sasori Posted August 24, 2008 Author Share Posted August 24, 2008 thanks sir Link to comment https://forums.phpfreaks.com/topic/121057-solved-set-default-help/#findComment-624106 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.