get_resources($villageid); $sql = "SELECT * FROM buildings WHERE id='$buildingid'"; $q = $this->db->query($sql); $building = $q->row_array(); if ($res['food'] >= $building['cost_food'] && $res['wood'] >= $building['cost_wood'] && $res['stone'] >= $building['cost_stone'] && $res['iron'] >= $building['cost_iron'] && $res['mana'] >= $building['cost_mana']) return TRUE; return FALSE; } } //nowhitesp