Gossamer Forum
Home : General : Perl Programming :

"MySQL Server has gone away" error... driving me mad!

Quote Reply
"MySQL Server has gone away" error... driving me mad!
Hi,

Can anyone see any reason why this would give me a "MySQL server has gone away" error?

Code:
my $dbh = DBI->connect( "dbi:mysql:$dbnames->{$site_to_go_on};host=$dbhosts->{$site_to_go_on}",$dbuser->{$site_to_go_on},$dbpass->{$site_to_go_on}, { RaiseError => 1, AutoCommit => 0 }) || die "Database connection not made: $DBI::errstr";

# first, we need to enter our values into lsql_Links
my $article = $DB->table('Articles')->select( ['Content'], { LinkID => $link_id } )->fetchrow;
my $sql = qq{ INSERT INTO lsql_Links (ID, Title, LinkOwner, Add_Date, Mod_Date, Description, upload_id, isPremium,PremiumDescription) VALUES ('', ?, 'new_admin', CURDATE(), CURDATE(), ? , ?, ?, ?) };
my $sth = $dbh->prepare( $sql );
$sth->execute($hit->{Title},$article,$hit->{ID},$hit->{isPremium},$hit->{PremiumDescription}) || die "Database connection not made: $DBI::errstr";
$sth->finish();
$dbh->disconnect();

Its driving me mad. All the other scripts work with almost exactly the same format... so I can't see why its giving me this error :/

The error line refers to the $sth->execute part.

TIA

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!
Subject Author Views Date
Thread; hot thread "MySQL Server has gone away" error... driving me mad! Andy 42072 Mar 23, 2005, 3:58 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Andy 41452 Mar 24, 2005, 12:59 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Andy 41391 Mar 24, 2005, 2:11 AM
Post; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41264 Mar 24, 2005, 4:52 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41473 Mar 24, 2005, 4:55 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41370 Mar 24, 2005, 5:46 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41416 Mar 24, 2005, 6:09 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41415 Mar 24, 2005, 6:23 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41466 Mar 24, 2005, 6:40 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41298 Mar 24, 2005, 6:44 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41368 Mar 24, 2005, 6:46 AM
Post; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41224 Mar 24, 2005, 7:05 AM
Post; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41154 Mar 24, 2005, 7:13 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41267 Mar 24, 2005, 7:21 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41353 Mar 24, 2005, 7:33 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41525 Mar 24, 2005, 7:36 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41490 Mar 24, 2005, 7:58 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41191 Mar 24, 2005, 8:08 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41385 Mar 24, 2005, 8:34 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41331 Mar 24, 2005, 8:40 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41498 Mar 24, 2005, 8:45 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Chaz 41352 Mar 24, 2005, 8:55 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41252 Mar 24, 2005, 8:56 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 5500 Mar 24, 2005, 9:10 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 5538 Mar 24, 2005, 9:19 AM
Post; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 5521 Mar 24, 2005, 10:17 AM
Post; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41207 Mar 24, 2005, 8:55 AM
Post; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41213 Mar 24, 2005, 6:33 AM