![]() |
print_r() is not printing all contents? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: print_r() is not printing all contents? (/showthread.php?tid=57633) |
print_r() is not printing all contents? - El Forum - 03-28-2013 [eluser]whygod[/eluser] Hi guys I'm not sure where the problem exactly is. controller: front.php Code: function index() { model: folio_model Code: function get_follow_links() view: master.php Code: <?php The problem is it only print only one value, Code: Array But the table followlinks has more than values. It has facebook url, twitter url, rss url, youtube url etc... Anyone would like to give shed to this? Thank you very much in advanced. print_r() is not printing all contents? - El Forum - 03-29-2013 [eluser]Aken[/eluser] All of your select items should be put in the first parameter, as a string or an array. select() does not accept unlimited parameters. Also, if you're only selecting one row from your DB, use row() or row_array(), not result/result_array. print_r() is not printing all contents? - El Forum - 03-29-2013 [eluser]whygod[/eluser] @aken thanks, but can you show me sample codes of SELECT? print_r() is not printing all contents? - El Forum - 03-29-2013 [eluser]TheFuzzy0ne[/eluser] $this->select() only accepts a single string, or an array of strings. So this: Code: $query = $this->db->select('facebook', 'twitter', 'rss', 'youtube', 'contact') becomes this: Code: $query = $this->db->select('facebook, twitter, rss, youtube, contact') // One string or this: Code: $query = $this->db->select(array( Also, if you're only expecting a single row to be returned, consider using row_array() instead of result_array(). print_r() is not printing all contents? - El Forum - 03-29-2013 [eluser]Aken[/eluser] [quote author="whygod" date="1364543450"]@aken thanks, but can you show me sample codes of SELECT? [/quote] The user guide comes in handy for these kinds of things. ![]() print_r() is not printing all contents? - El Forum - 03-29-2013 [eluser]whygod[/eluser] @TheFuzzy0ne Thank you very much for your effort. |