September 1st, 1999, 02:05 PM
I feel stupid for asking this since I know it should be straightforward. I'm developping a small site http://emma.btti.com/carolyn/spot. I'm using MySql to store the urls. I set the size of the column to 50 characters but as you can see, I'm now getting sites with the ends lobbed off. I need to alter the size of the columns. Like I said, I know this should be simple but I've been through every piece of documentation I can find and nothing seems to work. Please help.
September 1st, 1999, 03:21 PM
Look in the manual under ALTER table.
This is an example and I'm doing it from memory so you should still look it up as my memory isn't as good as it used to be
Lets say this is the original definition:
create table urls (id integer unsigned not null primary key auto_increment,
you can alter the table by using this:
alter table urls change url varchar(100);
This would make your max size 100.
September 1st, 1999, 05:54 PM
No luck. I tried it but I get a syntax error near varchar(100). What gives?
September 1st, 1999, 06:19 PM
I think you'll need to repeat the column's name. ie:
alter table urls change url url varchar(100);
The reason you need to do that is that you could change the column's name with the same command if you wanted to.
September 2nd, 1999, 05:07 AM
Thank you very much. That's it!