1

Possible Duplicate:
Setting up foreign keys in phpMyAdmin?

ALTER table podcategory add FOREIGN KEY (category_id) 
           REFERENCES category(category_id)
ON UPDATE RESTRICT
ON DELETE CASCADE

When i send script in phpmyadmin i get error

Can't create table './C292729_T25027/#sql-be0_30ed238.frm' (errno: 150)

How to add this FOREIGN KEY?

Community
  • 1
  • 1
Strannik
  • 466
  • 3
  • 6
  • 17

1 Answers1

0

try this type:

ALTER TABLE `aaaa` ADD CONSTRAINT fk_comp_id FOREIGN KEY ( `comp_id` ) REFERENCES `comps` ( `id` ); 

Or this SO answer/question might be able to help you out for sure: Setting up foreign keys in phpMyAdmin?

Community
  • 1
  • 1
Rob
  • 3,556
  • 2
  • 34
  • 53