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

Re: [Andy] how to delete links between id 2000 and id 3000

Quote Reply
Re: [Andy] how to delete links between id 2000 and id 3000 In reply to
Note that deleting links via SQL queries like this will result in records being left behind (you'll have entries left in the Bookmarks, and other tables that reference the Links table). Although not easy to do for most people, the best way is to write a short bit of code to do it, or use the admin interface (which probably won't work too tell for this number of links). Here's some (untested, though it should be fine) sample code:
Code:
#!/usr/bin/perl -w

use strict;
use lib '/path/to/admin';
use Links qw/:objects/;

Links::init('/path/to/admin');

$DB->table('Links')->delete(GT::SQL::Condition->new(ID => '>' => 2000, ID => '<' => 3000));

Adrian
Subject Author Views Date
Thread how to delete links between id 2000 and id 3000 rage 5103 Jul 9, 2007, 2:48 PM
Post Re: [rage] how to delete links between id 2000 and id 3000
blacknight 4936 Jul 10, 2007, 2:25 AM
Thread Re: [rage] how to delete links between id 2000 and id 3000
Andy 4950 Jul 10, 2007, 2:36 AM
Thread Re: [Andy] how to delete links between id 2000 and id 3000
brewt 4955 Jul 10, 2007, 1:07 PM
Post Re: [brewt] how to delete links between id 2000 and id 3000
Andy 4933 Jul 11, 2007, 2:47 AM
Thread Re: [brewt] how to delete links between id 2000 and id 3000
rage 4901 Jul 13, 2007, 9:48 AM
Post Re: [rage] how to delete links between id 2000 and id 3000
brewt 4933 Jul 13, 2007, 2:47 PM