This is weird. I have used the EXACT same code further up in the plugin, and now I try to use it a bit further down (in another sub), I get an error. The code is;
foreach (@in_data) {
# get all the data split up...
my ($full_title, $short_article, $article, $date_added, $todays_date) = split("$delimiter", $_);
# now we need to add it to the database...
my $database_connection = $DB->table("News");
$database_connection->add ( { title => $full_title,
short => $short_article,
full => $article,
date => $date_added,
nice_date => $todays_date
} ) or die ("Unable to add article. Reason: $GT::SQL::error");
print "Added $full_title<BR>";
}
The Error given is;'
Unable to add article. Reason: Failed to execute query: 'INSERT INTO lsql_News (full,nice_date,title,date,short) VALUES (?,?,?,?,?)' Reason: Duplicate entry '2147483647' for key 1 at /usr/local/psa/home/vhosts/ace-host.com/httpdocs/dumps/admin/Plugins/Ace_News.pm line 672.
Please enable debugging in setup for more details.
As I said, this code works perfectly a couple of subs above. I've printed out all the variables defined in the my(), and they all show up fine...its as soon as I try to use the add() I get an error.
Can anyone see whats going on?
BTW: The unique field is the 'date'.
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:
# now we can add it to the database... foreach (@in_data) {
# get all the data split up...
my ($full_title, $short_article, $article, $date_added, $todays_date) = split("$delimiter", $_);
# now we need to add it to the database...
my $database_connection = $DB->table("News");
$database_connection->add ( { title => $full_title,
short => $short_article,
full => $article,
date => $date_added,
nice_date => $todays_date
} ) or die ("Unable to add article. Reason: $GT::SQL::error");
print "Added $full_title<BR>";
}
The Error given is;'
Quote:
A fatal error has occured: Unable to add article. Reason: Failed to execute query: 'INSERT INTO lsql_News (full,nice_date,title,date,short) VALUES (?,?,?,?,?)' Reason: Duplicate entry '2147483647' for key 1 at /usr/local/psa/home/vhosts/ace-host.com/httpdocs/dumps/admin/Plugins/Ace_News.pm line 672.
Please enable debugging in setup for more details.
As I said, this code works perfectly a couple of subs above. I've printed out all the variables defined in the my(), and they all show up fine...its as soon as I try to use the add() I get an error.
Can anyone see whats going on?
BTW: The unique field is the 'date'.
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!