
Andy
Enthusiast
Karma: -1 / +7

Sep 26, 2005, 12:23 AM
Post #2 of 4
(2717 views)
Shortcut
Send Andy a wink
|
|
Re: [scottish] delete all links belonging to linkowner
[In reply to]
|
Can't Post
|
|
Hi, Try this;
#!/usr/local/bin/perl use strict; use lib './'; use Links qw/$IN $DB $CFG/; use GT::SQL; use GT::SQL::Condition; use CGI::Carp qw(fatalsToBrowser); local $SIG{__DIE__} = \&Links::fatal; Links::init('./'); my $user_to_delete = 'testing'; my $sth = $DB->table('Links')->select( { LinkOwner => $user_to_delete } ) || die $GT::SQL::error; while (my $hit = $sth->fetchrow_hashref) { print qq{Deleting $hit->{ID} \n }; $DB->table('Links')->delete( { ID => $hit->{ID} } ); } Save this as remove.cgi, and upload to your /admin folder. Just run with; perl remove.cgi Then watch it work <G> Cheers Andy Programmer/Designer/LinksSQL Freak http://www.ultranerds.com http://www.imagesql.com
|