Results 1 to 1 of 1

Thread: Help with SQL code for new table - I get error

  1. #1
    Join Date
    Mar 2005
    Location
    Western Australia
    Posts
    148
    Thanks
    24
    Thanked 4 Times in 4 Posts

    Default Help with SQL code for new table - I get error

    Hi guys

    I am trying to create a table in a joomla install and the sql I am using to create the table is

    Code:
    DROP TABLE IF EXISTS `jos_teams2_fields_data`;
    SET @saved_cs_client     = @@character_set_client;
    SET character_set_client = utf8;
    CREATE TABLE `jos_teams2_fields_data` (
      `id` int(11) NOT NULL auto_increment,
      `fieldid` int(11) default NULL,
      `data_txt` text,
      `data_bool` tinyint(1) default NULL,
      `itemid` int(11) default NULL,
      `expiration` datetime default NULL,
      PRIMARY KEY  (`id`),
      KEY `FK_teams2_custom_fields_data_1` (`fieldid`),
      KEY `itemid` (`itemid`),
      KEY `field_item` (`fieldid`,`itemid`),
      CONSTRAINT `FK_teams_custom_fields_data_1` FOREIGN KEY (`fieldid`) REFERENCES `jos_teams2_fields` (`fieldid`) ON DELETE CASCADE ON UPDATE CASCADE,
      CONSTRAINT `FK_teams_custom_fields_data_2` FOREIGN KEY (`itemid`) REFERENCES `jos_teams2_item` (`itemid`) ON DELETE CASCADE ON UPDATE CASCADE
    ) ENGINE=InnoDB AUTO_INCREMENT=141 DEFAULT CHARSET=latin1;
    SET character_set_client = @saved_cs_client;
    I get an error of

    #1005 - Can't create table './myDB_cms1/jos_teams2_fields_data.frm' (errno: 150)

    I have no idea of what the error is caused by within the above sql statement and where to fix - please help.

    I am trying to restore some mysql data from a backup and I was simply trying to run the sql I exported table by table and got as far as the above error.

    Cheers
    Last edited by gwmbox; 04-16-2009 at 07:06 AM.
    1st rule of web development - use Firefox and Firebug
    2nd rule - see the first rule
    --
    I like Smilies

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •