sql - MySQL InnoDB CASCADE? -


I am starting to experiment with using inodb in web applications. I have set up some tables with a foreign key, but they are not as expected here my table statement has been prepared:

  create table section (section_id INT not tap AUTONCRR, title VAARAAR (30), made_at int (10) noise, updated init (10) faucet, primary key (section_id) engine = INODB; Create table pages (page_id INT not tap AUTONCRment, section_idfq INT, primary key (page_id), foreign key (section_IDfK) reference section (section_id) updated on cached delimited cadet on engine) = ennodibi; Make the tables fine and I can populate them with data, however, I was hoping to make any changes to the table table that would affect the related rows in the page table. I tried to change the ID of a section and completely remove a section. In both cases, the page table was unaffected.  

Can anyone see where I am wrong?

Any advice appreciated. Thank you

I soon placed two identical tables in the MySQL query browser with the following definitions:

  DROP If tested, then 'test'. 'Section'; Create the table 'Test'. 'Section' ('section_ID' at (10) unsigned, not auto_interment, `title 'varchar (30) not tap,` created' at (10) unsigned zero, `updated_at` int (10) unsigned null, primary Key (`section_id`)) engine = InDebiAtangentment = 2 default charge = UTF8; Falling table if 'test' 'Pages'; The table `test` is created.` The page '(` Page_ID` et (10) is not unsigned, auto_interpret, `section_idfk` int (10) unsigned null, primary key (` page_id`), key' section_idfk` (`section_idfk`) , Contract `section_idf` foreign key (` section_idf`) reference 'class' (`section_id`) on the update cadet on delimited cadet) Engine = Indodebi AutoGenment = 2 default charge = UTF8;  

Not like people posted by you, but close enough.

I insert sections in one line, I add a line with a matching section_id in the pages table. Then I delete one from the sections;

Edit - I've recorded your creations and it works fine too.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -