sub main { @atime = getdate(); $stime = @atime[0]; $sdate = @atime[1]; $sql = "SELECT * FROM logs WHERE date = ? AND time >= ?"; execmysql($stime,$sdate,$sql); } sub execmysql { $stime = shift; $sdate = shift; $sql = shift; $sth = $dbh->prepare($sql); $sth->execute($sdate,$stime); } error I get DBD::mysql::st execute failed: MySQL server has gone away at ./report.pl line 73.