|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Creating Table Question
I am creating a table on a virtually hosted mySQL server. I have created tons of tables and for some reason I am getting syntax errors when creating this one. Now, I am functioning off of 6 hours sleep in the last 5 days, so I may just be going nuts. I figure a set of rested eyes could help me.
CREATE TABLE `a960_web` (`IDNUM` SMALLINT(25) NOT NULL AUTO_INCREMENT, `LINK` TEXT(25) NOT NULL, `URL` TEXT(50) NOT NULL, `LINK_CAT` TEXT(25) NOT NULL , PRIMARY KEY (`IDNUM`), UNIQUE (`IDNUM`)) comment = 'A960_Site_Links' I am using a mySQLAdmin to create the table. I also tried placing the code in a text file and submitting it. going to try the command line next, but I just wanted to through this past you. |
|
#2
|
|||
|
|||
|
RE: Creating Table Question
Okay, I got it working. I changed the field types from TEXT to VARCHAR and that did it. I will refer back to it later after I rest, but I am sure there is a logical reason for that.
CREATE TABLE `a960_web` (`IDNUM` TINYINT(4) NOT NULL AUTO_INCREMENT, `LINK` VARCHAR(25) NOT NULL, `URL` VARCHAR(25) NOT NULL, `LINK_CAT` VARCHAR(25) NOT NULL , PRIMARY KEY (`IDNUM`), UNIQUE (`IDNUM`)) comment = 'A960_Site_Links' Thanks anyway. By the way, this site seems to be a great resource and a great idea. |
|
#3
|
|||
|
|||
|
RE: Creating Table Question
TEXT fields don't have a length specifier (25)... BTW, SMALLINT(25) makes no sense - the biggest number you can store is 32768 anyway. for URLs, 25 characters isn't enough, it'd be better if you used 255. And UNIQUE(IDNUM) makes no sense either - it's already primary key, which is unique anyway...
|
|
#4
|
|||
|
|||
|
RE: Creating Table Question
Thanks for the observations. I guess that would explain performance issues with some of the databases I have created.
Once again, thanks. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Creating Table Question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|