|
Posted by Brian on 07/29/05 17:37
"Stefan Rybacki" <stefan.rybacki@gmx.net> wrote in message
news:3ku6e6F104j8bU2@individual.net...
> Brian wrote:
>> 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
>>
>
> Thats fine, since myISAM tables just ignore FOREIGN KEY declarations and
> don't use them
>
>> 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?
>
> Yes you have had to add a ON DELETE CASCADE statement (see the manual),
> but it won't work on myISAM either.
>
>>
>> and I tried
>>
>> ALTER TABLE t2sadvertlibrary ADD FOREIGN KEY (filename) REFERENCES
>> t2sprofiles (filename1) ON DELETE CASCADE
>>
>
> Oh ok, you got it ;)
>
>> then
>>
>> DELETE FROM advertlibrary WHERE filename = '1122246317.jpg'
>>
>> Still did not work
>>
>
> As I said, its because of the myISAM tables
>
>> Brian
>>
I have just heard from my hosting company, and because it's a sheared server
they
do not support INNODB, so I'm back to the beginning, what's the best way to
do what
I need 2 do on a myISAM table?
Once again, thanks for your help and still open to suggestions
Brian
Navigation:
[Reply to this message]
|