Issue with returned data from a model and getting output - 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: Issue with returned data from a model and getting output (/showthread.php?tid=2369) |
Issue with returned data from a model and getting output - El Forum - 08-01-2007 [eluser]awpti[/eluser] Error with mini-description is here: http://www.awpti.org/links/linkout/3/ Model: Code: class Linksmodel extends Model { And the controller: Code: class Links extends Controller { I'm stumped. Do I need to do some goofy loop action for a single returned entry? Issue with returned data from a model and getting output - El Forum - 08-01-2007 [eluser]BravoAlpha[/eluser] [quote author="awpti" date="1185972648"]Do I need to do some goofy loop action for a single returned entry?[/quote] User Guide: Generating Query Results [quote author="User Guide"]result() This function returns the query result as an array of objects, or an empty array on failure. ... row() This function returns a single result row.[/quote] FWIW, I've been using something like this for functions that should return a single row: Code: function select_single($discussion_id) Issue with returned data from a model and getting output - El Forum - 08-01-2007 [eluser]awpti[/eluser] Sometimes I feel completely stupid. Simplest thing in the world. On a side note, I didn't like how redirect() doesn't allow you to redirect "offsite", so I dropped in my own little redirect_offsite() function. I suppose I could have just added another case to the switch() statement in redirect(), but I wanted to leave the code vanilla there. Thanks for the help, Bravo. |