%s

",$celestialSQL); $rsCelestial = mysql_query($celestialSQL,$whConn); if ($rsCelestial) { if (mysql_num_rows($rsCelestial) == 1) { $sRow = mysql_fetch_object($rsCelestial); if ($sRow) { $this->iItemID = $sRow->itemID; $this->sItemName = $sRow->itemName; $this->iTypeID = $sRow->typeID; $this->sTypeName = $sRow->typeName; $this->dX = $sRow->x; $this->dY = $sRow->y; $this->dZ = $sRow->z; $this->iOrbitID = $sRow->orbitID; $this->iGroupID = $sRow->groupID; } } mysql_free_result($rsCelestial); } } public function X() { return $this->dX; } public function Y() { return $this->dY; } public function Z() { return $this->dZ; } public function itemID() { return $this->iItemID; } public function Name() { return $this->sItemName; } public function typeID() { return $this->iTypeID; } public function TypeOf() { return $this->sTypeName; } public function isPlanet() { return $this->iGroupID == self::GROUPID_PLANET; } public function isMoon() { return $this->iGroupID == self::GROUPID_MOON; } public function orbitID() { return $this->iOrbitID; } public function planetType() { preg_match_all('/(.*)\((.*)\)/', $this->sTypeName, $matches); return ($this->isPlanet() && is_array($matches)) ? $matches[2][0] : false; } } ?>