You are here: Re: SQL statments advice « PHP Language « IT news, forums, messages
Re: SQL statments advice

Posted by Brian on 10/02/34 11:23

Stefan wrote:

>>>Read about foreign kyes
>>
>> foreign keys in MySQL?
>
> Yes supported in InnoDBs. You should have a look at CASCADE ...


I might be missing something here, but I have done the following though a
PHPMyAdmin
on my server.

ALTER TABLE advertlibrary TYPE = InnoDB
ALTER TABLE profiles TYPE = InnoDB
(can't use ENGINE = INNODB as
ALTER TABLE advertlibrary ADD FOREIGN KEY (filename) REFERENCES profiles
(filename1)

No errors came back

then I ran

DELETE FROM advertlibrary WHERE filename = '1122246317.jpg'

It deleted it from advertlibrary table but not form the profiles table, have
i missed something here?

and I tried

ALTER TABLE t2sadvertlibrary ADD FOREIGN KEY (filename) REFERENCES
t2sprofiles (filename1) ON DELETE CASCADE

then

DELETE FROM advertlibrary WHERE filename = '1122246317.jpg'

Still did not work

Brian

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация