my $addships = $dbh->prepare(q{INSERT INTO fleet_ships (id,ship,amount) VALUES(?,?,?)});
my $addpdata = $dbh->prepare(q{INSERT INTO planet_data (id,tick,scan,rid,amount) VALUES(?,?,?,(SELECT id FROM planet_data_types WHERE category = ? AND name = ?), ?)});
my $addships = $dbh->prepare(q{INSERT INTO fleet_ships (id,ship,amount) VALUES(?,?,?)});
my $addpdata = $dbh->prepare(q{INSERT INTO planet_data (id,tick,scan,rid,amount) VALUES(?,?,?,(SELECT id FROM planet_data_types WHERE category = ? AND name = ?), ?)});
while (my $scan = $newscans->fetchrow_hashref){
my $file = get("http://game.planetarion.com/showscan.pl?scan_id=$scan->{scan_id}");
next unless defined $file;
while (my $scan = $newscans->fetchrow_hashref){
my $file = get("http://game.planetarion.com/showscan.pl?scan_id=$scan->{scan_id}");
next unless defined $file;
print "Something wrong with scan $scan->{id} type $type at tick $tick http://game.planetarion.com/showscan.pl?scan_id=$scan->{scan_id}";
}
$parsedscan->execute($tick,$type,$planet,$scan->{id}) or die $dbh->errstr;
print "Something wrong with scan $scan->{id} type $type at tick $tick http://game.planetarion.com/showscan.pl?scan_id=$scan->{scan_id}";
}
$parsedscan->execute($tick,$type,$planet,$scan->{id}) or die $dbh->errstr;