Welcome Guest, Not a member yet? Register   Sign In
database class :: select via array?
#1

[eluser]ner0tic[/eluser]
i was looking through the forums and the userguide and couldn't find an answer.

real easy one, can i use an array in the select method of the db class?

ie:
$arr = array('id','name','date');
$this->db->select($arr);
#2

[eluser]davidbehler[/eluser]
You could have tried it yourself, but you are lucky that I am curious aswell and tried it for you:

Code:
$this->db->select(array('id', 'name', 'date'));
works just fine

Seems not to be document, maybe someone can update the user guide.
#3

[eluser]ner0tic[/eluser]
[quote author="waldmeister" date="1233533346"]You could have tried it yourself, but you are lucky that I am curious aswell and tried it for you:

Code:
$this->db->select(array('id', 'name', 'date'));
works just fine

Seems not to be document, maybe someone can update the user guide.[/quote]

sorry i didn't follow up. I just tried it when i got a second to go back to it. I was dealing with odd data being returned from a bad index i grabbed from the result, but yes adding this to the user_guide wouldn't hurt.




Theme © iAndrew 2016 - Forum software by © MyBB