Cita:
Esta la tabla que inserto con los datos:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOREIGN KEY (Category) REFERENCES Categories (id) ON DELETE CASCADE ) ENGINE=In' at line 11
CREATE TABLE `Wallpapers` ( `ID` int(11) NOT NULL auto_increment, `Title` text NOT NULL, `Category` text NOT NULL, `Thumbnail` text NOT NULL, `Thumbdetails` text NOT NULL, `Image_Small` text NOT NULL, `Image_Large` text NOT NULL, `Hits` int(11) NOT NULL default '0', PRIMARY KEY (`ID`) FOREIGN KEY (Category) REFERENCES Categories (id) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=82
CREATE TABLE `Wallpapers` ( `ID` int(11) NOT NULL auto_increment, `Title` text NOT NULL, `Category` text NOT NULL, `Thumbnail` text NOT NULL, `Thumbdetails` text NOT NULL, `Image_Small` text NOT NULL, `Image_Large` text NOT NULL, `Hits` int(11) NOT NULL default '0', PRIMARY KEY (`ID`) FOREIGN KEY (Category) REFERENCES Categories (id) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=82
Código PHP:
$Base_SQL[] = "CREATE TABLE `Wallpapers` (
`ID` int(11) NOT NULL auto_increment,
`Title` text NOT NULL,
`Category` text NOT NULL,
`Thumbnail` text NOT NULL,
`Thumbdetails` text NOT NULL,
`Image_Small` text NOT NULL,
`Image_Large` text NOT NULL,
`Hits` int(11) NOT NULL default '0',
PRIMARY KEY (`ID`)
FOREIGN KEY (Category) REFERENCES Categories (id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=82 ;
";
FOREIGN KEY (Category) REFERENCES Categories (id) ON DELETE CASCADE