![]() |
Returning Boolean Values from model not working - 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: Returning Boolean Values from model not working (/showthread.php?tid=12769) |
Returning Boolean Values from model not working - El Forum - 10-30-2008 [eluser]timboland[/eluser] I seem to be getting some odd results returning a boolean value from a model. Appears the type is lost when the result gets back to the controller, the controller keeps showing the value as FALSE, when I can see the logic should be returning true. Anyone seen this. Using 1.6.3 MODEL Code: function UpdateClientEmail($data) CONTROLLER Code: function edituserfast($type) Returning Boolean Values from model not working - El Forum - 10-30-2008 [eluser]fesweb[/eluser] I think your function should actually return true or false, not a variable. Try this: Code: function UpdateClientEmail($data) Returning Boolean Values from model not working - El Forum - 10-31-2008 [eluser]timboland[/eluser] I had that before, no dice Returning Boolean Values from model not working - El Forum - 10-31-2008 [eluser]GSV Sleeper Service[/eluser] your code should work. you could try Code: return (bool) $mybool; Returning Boolean Values from model not working - El Forum - 10-31-2008 [eluser]fesweb[/eluser] Have you tried adding some debugging echoes to at least make sure that your function is returning the expected results? Code: $mybool = true; Returning Boolean Values from model not working - El Forum - 10-31-2008 [eluser]timboland[/eluser] Yes, I swear ![]() Returning Boolean Values from model not working - El Forum - 10-31-2008 [eluser]fesweb[/eluser] Weird. Anyway, my last idea on this is to try having your function return the num_rows() value instead of the $mybool. Then you can test that with your controller. Doesn't solve the larger problem, but it should make the controller work. Code: //UPDATE |