jcoones Posted October 24, 2007 Share Posted October 24, 2007 I have a table called 'custom fields'. In this table I have cust_id, cust_adtype, cust_fieldtype, cust_title. cust_fieldtype is a TEXTAREA with a value of VARCHAR(40). I want to change it to VARCHAR(100). Can someone tell my how to do that in mu cpanel? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/74609-solved-need-help-to-edit-mysql-table/ Share on other sites More sharing options...
fenway Posted October 24, 2007 Share Posted October 24, 2007 Don't know cpanel... but you can issue a simple ALTER TABLE statement. Quote Link to comment https://forums.phpfreaks.com/topic/74609-solved-need-help-to-edit-mysql-table/#findComment-377100 Share on other sites More sharing options...
jcoones Posted October 24, 2007 Author Share Posted October 24, 2007 Thank you very much, however, can you give me an example? I'm not up on MySQL. This is an excerpt from the .sql file used to set up all of the tables. This is the section of the .sql file that sets up the customfields table. -------------------------------------------------------------------- CREATE TABLE `customfields` ( `cust_id` int(11) NOT NULL auto_increment, `cust_adtype_id` int(11) NOT NULL default '0', `cust_field_type` varchar(40) NOT NULL default '', <----- This is what I need to change! `cust_order` int(11) NOT NULL default '0', `cust_title` varchar(20) NOT NULL default '', `cust_include_search` tinyint(1) NOT NULL default '0', `cust_include_search_results` tinyint(1) NOT NULL default '0', PRIMARY KEY (`cust_id`) ) TYPE=InnoDB; --------------------------------------------------------------------- How would I use the ALTERTABLE in this instance? Your help is very much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/74609-solved-need-help-to-edit-mysql-table/#findComment-377106 Share on other sites More sharing options...
fenway Posted October 24, 2007 Share Posted October 24, 2007 ALTER TABLE customfields MODIFY COLUMN `cust_field_type` varchar(100) NOT NULL default ''; Quote Link to comment https://forums.phpfreaks.com/topic/74609-solved-need-help-to-edit-mysql-table/#findComment-377140 Share on other sites More sharing options...
jcoones Posted October 24, 2007 Author Share Posted October 24, 2007 Thank you very much. I appreciate your help. Quote Link to comment https://forums.phpfreaks.com/topic/74609-solved-need-help-to-edit-mysql-table/#findComment-377161 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.