---
name: evolution_getfieldarray_deprecated
description: getFieldArray() is deprecated in Evolution; new code must use DB::SELECT
metadata: 
  node_type: memory
  type: feedback
  originSessionId: 8a7e3438-fb27-479c-ace3-aae13c8717e1
---

`getFieldArray($fields,$table,$where)` (defined `functions.php:1677`, cron twin `cron/min_functions.php:374`) is **deprecated** — do not use it in any new Evolution code.

**Why:** it interpolates raw SQL (no bound params) and returns `FETCH_ASSOC` arrays; the house convention (`.claude/CLAUDE.md`) is prepared statements via the `DB::` class.

**How to apply:** for multi-row SELECTs use `DB::SELECT($query,$vars,$limit)` from `library/db.php` with bound `?` params. Note the row-access difference: getFieldArray gives `$row['col']`; `DB::SELECT` defaults to `FETCH_OBJ` so use `$row->col` (or pass `PDO::FETCH_ASSOC` as the 5th arg to keep array access). Don't refactor pre-existing working getFieldArray calls unless you're already editing that line. Beware when mirroring old files (invoice.php, accounting.php) — they use getFieldArray heavily; translate, don't copy. Related: [[evolution_two_accounting_files]].
