|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
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.
Carolyn |
|
#2
|
|||
|
|||
|
Carolyn,
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 URL Lets say this is the original definition: create table urls (id integer unsigned not null primary key auto_increment, url varchar(50)); you can alter the table by using this: alter table urls change url varchar(100); This would make your max size 100. HTH Rod |
|
#3
|
|||
|
|||
|
No luck. I tried it but I get a syntax error near varchar(100). What gives?
|
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
Thank you very much. That's it!
|
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Altering column sizes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|