- my $f = $ND::DBH->prepare("SELECT ruler,planet,race,score,size,value,scorerank,sizerank,valuerank, xp, xprank, alliance FROM current_planet_stats WHERE x = ? AND y = ? and z = ?");
- $f->execute($x,$y,$z);
- while (my @row = $f->fetchrow()){
- @row = map (valuecolor(1),@row);
+ my $f = $ND::DBH->prepare(q{SELECT coords(x,y,z),ruler,planet,race,score,size,value,scorerank,sizerank,
+ valuerank, xp, xprank, alliance, relationship, nick, planet_status, hit_us, channel
+ FROM current_planet_stats WHERE (x = $1 AND y = $2 and z = $3) OR nick ILIKE $4 LIMIT 1
+ });
+ $f->execute($x,$y,$z,$nick);
+ if (my $planet = $f->fetchrow_hashref()){
+ for (keys %{$planet}){
+ $planet->{$_} = valuecolor(1,$planet->{$_});
+ }