Though this will increase the number of requests to the database, you could also the fields and construct the query in a loop before posting will reduce your code look fancy with possible bug increase more processing, but wont really make any difference in the final result.
$sql = "SELECT
p.id,p.po_number,p.project,p.package_no,p.po_creation_date,p.atd_ex_works, p.etd_ex_works, p.customer,p.contractor,p.site,p.stock_code,p.part_number,p.line_items,p.unit_measure,p.order_qty, p.standing_qty, p.supplier, p.date_required, p.priority, p.archived FROM `purchase_orders` p WHERE deleted=0 AND archived=0 ";
$fields = $this->db->list_fields('table_name');
foreach ($fields as $field) {
if ($field != "exclude_field")
$q[] = "$field LIKE %$search_term%";
}
if (count($q) > 0) {
$sql .= " and " . implode(" or ", $q);
}
$this->db->query($sql)->result();
Hope that was helpful