CodeIgniter Forums
Passing array of fields to select - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Libraries & Helpers (
+--- Thread: Passing array of fields to select (/showthread.php?tid=44235)

Passing array of fields to select - El Forum - 08-08-2011

In documentation it is told that you can pass only string to ActiveRecord's select method, but looking at code, I see, that it is possible to pass array too. Actually it gets converted to array if it is comma-separated string.
if (is_string($select))
    $select = explode(',', $select);
So the question is: is it OK if I pass array to select (will it work in next versions of CodeIgniter)? Or maybe you could add this to documentation?

The reason why I need to pass array (not string) of fields is because the list is generated dynamically and it is easier to manipulate arrays than comma-separated strings.