Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [Andy] Valid format for update() with CatLinks.CategoryID ?

Quote Reply
Re: [Andy] Valid format for update() with CatLinks.CategoryID ? In reply to
You should use the delete/insert methods instead of do_query in order to handle any foreign keys.

Code:
$DB->table('CatLinks')->delete({ LinkID => $link->{ID} });
foreach (@CategoryIDs) {
$DB->table('CatLinks')->insert({ LinkID => $link->{ID}, CategoryID => $_ });
}

Last edited by:

Wychwood: May 12, 2008, 9:59 AM
Subject Author Views Date
Thread Valid format for update() with CatLinks.CategoryID ? Andy 3119 May 11, 2008, 4:18 AM
Thread Re: [Andy] Valid format for update() with CatLinks.CategoryID ?
Wychwood 3023 May 11, 2008, 5:16 PM
Thread Re: [Wychwood] Valid format for update() with CatLinks.CategoryID ?
Andy 3017 May 11, 2008, 11:52 PM
Thread Re: [Andy] Valid format for update() with CatLinks.CategoryID ?
Andy 3022 May 12, 2008, 2:27 AM
Thread Re: [Andy] Valid format for update() with CatLinks.CategoryID ?
Wychwood 3013 May 12, 2008, 9:57 AM
Post Re: [Wychwood] Valid format for update() with CatLinks.CategoryID ?
Andy 3012 May 12, 2008, 10:01 AM
Thread Re: [Andy] Valid format for update() with CatLinks.CategoryID ?
brewt 2996 May 12, 2008, 1:32 PM
Post Re: [brewt] Valid format for update() with CatLinks.CategoryID ?
Andy 2985 May 12, 2008, 2:02 PM