Try this script via Telnet/SSH;
use strict;
use lib './';
use Links qw/$IN $DB $CFG/;
local $SIG{__DIE__} = \&Links::fatal;
Links::init('./');
my $DEBUG = 1;
# first of all, lets actually get rid of all the categories...
my @id_list;
my $table = $DB->table('CatLinks');
my $sth = $table->select() || die $GT::SQL::error;
while (my $hit = $sth->fetchrow_hashref) {
if ($DB->table('Category')->count( { ID => $hit->{CategoryID} } ) < 1) {
print "Category ID $hit->{CategoryID} doesn't seem to exist... \n";
}
}
print "Finished .... ";
It should print out a list of bad category ID's, which are assigned to active links.
Hope that helps.
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Code:
#!/usr/bin/perl use strict;
use lib './';
use Links qw/$IN $DB $CFG/;
local $SIG{__DIE__} = \&Links::fatal;
Links::init('./');
my $DEBUG = 1;
# first of all, lets actually get rid of all the categories...
my @id_list;
my $table = $DB->table('CatLinks');
my $sth = $table->select() || die $GT::SQL::error;
while (my $hit = $sth->fetchrow_hashref) {
if ($DB->table('Category')->count( { ID => $hit->{CategoryID} } ) < 1) {
print "Category ID $hit->{CategoryID} doesn't seem to exist... \n";
}
}
print "Finished .... ";
It should print out a list of bad category ID's, which are assigned to active links.
Hope that helps.
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!