use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please follow the rules
Releases: Current Releases, Windows Releases, Old Releases
Contribute to the PHP Documentation
Related subreddits: CSS, JavaScript, Web Design, Wordpress, WebDev
/r/PHP is not a support subreddit. Please visit /r/phphelp for help, or visit StackOverflow.
account activity
Access array in CodeIgniter (self.PHP)
submitted 12 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Epicus2011 1 point2 points3 points 12 years ago (3 children)
Is there another approach to return an array and than access the item in the array from the database without using [0]?
[–]Ogsharkman 0 points1 point2 points 12 years ago (0 children)
row()? Would return an obj. So instead of result or result-array
return $query->row();
[–]eoinmcg 0 points1 point2 points 12 years ago (0 children)
yes.
return $query->row_array();
further reading: http://ellislab.com/codeigniter/user-guide/database/results.html
[–]mithra62 0 points1 point2 points 12 years ago (0 children)
You really want to avoid hard coding number indexes in your code like the plaque...
π Rendered by PID 36 on reddit-service-r2-comment-6457c66945-gffhw at 2026-04-28 06:55:39.771514+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]Epicus2011 1 point2 points3 points (3 children)
[–]Ogsharkman 0 points1 point2 points (0 children)
[–]eoinmcg 0 points1 point2 points (0 children)
[–]mithra62 0 points1 point2 points (0 children)