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]
|