Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/01/2009, 02:12
jurena
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 16 años, 1 mes
Puntos: 300
Respuesta: ERROR 1005 (HY000): Can't create table (errno: 150)

Antes debes haber creado la tabla usuarios con una primary key llamada userID que sea mediumint(8) unsigned auto_increment.

Luego

CREATE TABLE notas (
`notasID` int(10) unsigned NOT NULL auto_increment,
`userID` mediumint(8) unsigned NOT NULL,
`posterTime` int(10) unsigned NOT NULL default '0',
`posterIP` tinytext NOT NULL,
`titulo` tinytext NOT NULL,
`cuerpo` text NOT NULL,
`tags` varchar(16),
`categoria` varchar(16) NOT NULL default 'xx',
FOREIGN KEY (`userID`) references usuarios (`userID`),
PRIMARY KEY (`notasID`)
) ENGINE=InnoDB;

Y creo que debería funcionar.