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 41917 Mar 23, 2005, 3:58 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Andy 41299 Mar 24, 2005, 12:59 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Andy 41238 Mar 24, 2005, 2:11 AM
Post; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41110 Mar 24, 2005, 4:52 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41319 Mar 24, 2005, 4:55 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41216 Mar 24, 2005, 5:46 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41261 Mar 24, 2005, 6:09 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41262 Mar 24, 2005, 6:23 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41312 Mar 24, 2005, 6:40 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41145 Mar 24, 2005, 6:44 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41214 Mar 24, 2005, 6:46 AM
Post; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41070 Mar 24, 2005, 7:05 AM
Post; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41000 Mar 24, 2005, 7:13 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41114 Mar 24, 2005, 7:21 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41198 Mar 24, 2005, 7:33 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41372 Mar 24, 2005, 7:36 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41336 Mar 24, 2005, 7:58 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41038 Mar 24, 2005, 8:08 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41230 Mar 24, 2005, 8:34 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41177 Mar 24, 2005, 8:40 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 41344 Mar 24, 2005, 8:45 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Chaz 41198 Mar 24, 2005, 8:55 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41099 Mar 24, 2005, 8:56 AM
Thread; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 5468 Mar 24, 2005, 9:10 AM
Thread; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 5506 Mar 24, 2005, 9:19 AM
Post; hot thread Re: [Andy] "MySQL Server has gone away" error... driving me mad!
Chaz 5489 Mar 24, 2005, 10:17 AM
Post; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41054 Mar 24, 2005, 8:55 AM
Post; hot thread Re: [Chaz] "MySQL Server has gone away" error... driving me mad!
Andy 41060 Mar 24, 2005, 6:33 AM