Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
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  
Old January 19th, 2003, 06:48 PM
joneal joneal is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Cincinnati, Oh, USA
Posts: 3 joneal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to joneal
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.

Reply With Quote
  #2  
Old January 19th, 2003, 06:58 PM
joneal joneal is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Cincinnati, Oh, USA
Posts: 3 joneal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to joneal
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.

Reply With Quote
  #3  
Old January 19th, 2003, 08:38 PM
xs0 xs0 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Ljubljana, Slovenia
Posts: 760 xs0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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...

Reply With Quote
  #4  
Old January 20th, 2003, 02:28 PM
joneal joneal is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Cincinnati, Oh, USA
Posts: 3 joneal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to joneal
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.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Creating Table Question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway