MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 24th, 2004, 04:45 AM
shortrnd shortrnd is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 1 shortrnd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
error 1064 syntax error

can some tell me why i can not join this table, this has been driving me crazy.

CREATE TABLE `state` (
`id` int(11) NOT NULL auto_increment,
`state` varchar(4) NOT NULL default '',
`state_name` varchar(12) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=InnoDB;

===========

CREATE TABLE `company` (
`id` int(11) NOT NULL auto_increment,
`company_name` varchar(40) NOT NULL default '',
`comp_add1` varchar(40) NOT NULL default '',
`comp_add2` varchar(40) default NULL,
`comp_city` varchar(20) NOT NULL default '',
`comp_zip` tinyint(4) NOT NULL default '0',
`comp_balance` decimal(2,0) default NULL,
`state_id` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `state_id` (`state_id`),
CONSTRAINT `company_ibfk_1` FOREIGN KEY (`state_id`) REFERENCES `state` (`id`) ON UPDATE CASCADE
) TYPE=InnoDB;


=========

CREATE TABLE `customer` (
`Id` int(11) NOT NULL auto_increment,
`cust_fname` varchar(100) NOT NULL default '',
`cust_lname` varchar(100) NOT NULL default '',
`state_id` int(11) NOT NULL default '0',
PRIMARY KEY (`Id`),
KEY `state_id` (`state_id`)
CONSTRAINT `company_ibfk_2` FOREIGN KEY (`state_id`) REFERENCES `state` (`id`) ON UPDATE CASCADE
) TYPE=InnoDB;


I can can not get the customer table to connect to the states table.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > error 1064 syntax error


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 4 hosted by Hostway
Stay green...Green IT