Gossamer Forum
Home : Products : Gossamer Links : Discussions :

resetting Links ID field

Quote Reply
resetting Links ID field
I've been test importing various datafeeds into GLinks 3.02. Is it possible/how do I reset the links ID field before doing the final (total) import and putting the website live?
Quote Reply
Re: [Alba] resetting Links ID field In reply to
Hi,

You can do it with;

Quote:
ALTER TABLE lsql_Category AUTO_INCREMENT = 0
ALTER TABLE lsql_CatLinks AUTO_INCREMENT = 0
ALTER TABLE lsql_Links AUTO_INCREMENT = 0

...or a code equevilant;

Code:
use DBI;
my $DBH = DBI->connect("DBI:mysql:DBNAME:localhost", 'DATABASE_NAME', 'PASSWORD') || die DBI->errstr;

my $_q = "ALTER TABLE lsql_Links AUTO_INCREMENT = 0";
my $sth = $DBH->prepare($_q) || die $DBH->errstr;
$sth->execute() || die $DBH->errstr;

my $_q = "ALTER TABLE lsql_CatLinks AUTO_INCREMENT = 0";
my $sth = $DBH->prepare($_q) || die $DBH->errstr;
$sth->execute() || die $DBH->errstr;

my $_q = "ALTER TABLE lsql_Category AUTO_INCREMENT = 0";
my $sth = $DBH->prepare($_q) || die $DBH->errstr;
$sth->execute() || die $DBH->errstr;

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!