hi, in the script you have " CONSTRAINT `0_132` FOREIGN KEY ( `SCode` ) REFERENCES `statesarticles` ( `SCode` ) ON UPDATE CASCADE " and this code it's a definition of the foreign key. run the script without this part of the code.
Citando David Blomstrom <[EMAIL PROTECTED]>: > When I was first learning to work with MySQL, I > discovered that I couldn't publish my databases to the > Internet if they had foreign keys. So I stripped out > all the foreign keys and got them online. > > I'm not trying to publish a table I haven't worked > with in a while, but I just get error messages. The > error message suggests it's a foreign key problem; at > the very least, it suggests the table has a foreign > key. But I can't remember how to even tell if a > foreign key is present. When I look at my table in > PPHPmyadmin, I just see one key - a primary key - > under Keyname. > > When I click on SCode - the field that supposedly has > the foreign key, I see no reference to a foreign key. > > I pasted the error message below. Can someone tell me > what I'm missing? > > Thanks. > > SQL-query: > > # phpMyAdmin SQL Dump > # version 2.5.3 > # http://www.phpmyadmin.net > # > # Host: localhost > # Generation Time: Aug 17, 2004 at 08:52 AM > # Server version: 4.0.16 > # PHP Version: 4.3.4 > # > # Database : `world` > # > # > -------------------------------------------------------- > # > # Table structure for table `counties` > # > CREATE TABLE `counties` ( > `SCode` varchar( 6 ) NOT NULL default '', > `NameC` varchar( 255 ) default NULL , > `TypeC` varchar( 255 ) default NULL , > `Seat` varchar( 255 ) default NULL , > `Area_MI` decimal( 10, 1 ) default NULL , > `Area_KM` decimal( 10, 1 ) default NULL , > `Pop_2000` int( 10 ) default NULL , > `Pop_1990` int( 10 ) default NULL , > `Pop_MI` decimal( 10, 1 ) default NULL , > `Pop_KM` decimal( 10, 1 ) default NULL , > `Race1` int( 10 ) default NULL , > `Race2` int( 10 ) default NULL , > `Amerindian` int( 10 ) default NULL , > `White` int( 10 ) default NULL , > `Black` int( 10 ) default NULL , > `Asian` int( 10 ) default NULL , > `Pacific_Island` int( 6 ) default NULL , > `Some_Other_Race` int( 10 ) default NULL , > `Hispanic` int( 10 ) default NULL , > `id` int( 6 ) NOT NULL AUTO_INCREMENT , > PRIMARY KEY ( `id` ) , > KEY `SCode` ( `SCode` ) , > CONSTRAINT `0_132` FOREIGN KEY ( `SCode` ) REFERENCES > `statesarticles` ( `SCode` ) ON UPDATE CASCADE > ) TYPE = InnoDB PACK_KEYS =0 AUTO_INCREMENT =3143 > > MySQL said: Documentation > #1005 - Can't create table > './world_gypsy/counties.frm' (errno: 150) > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page – Try My Yahoo! > http://my.yahoo.com > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > > Ganha Câmaras de Filmar, Televisões e outros fantásticos prémios Samsung com o SAPO! Clica em http://dc.sapo.pt/sfc -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]