CodeIgniter Forums
how to use model? - 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: how to use model? (/showthread.php?tid=12263)

Pages: 1 2 3


how to use model? - El Forum - 10-13-2008

[eluser]syntaxerror[/eluser]
i replace return with echo. and it loops,
what is the difference between echo and return.


how to use model? - El Forum - 10-13-2008

[eluser]xwero[/eluser]
return breaks the loop. You have to move the return outside the loop.

I suggest you first learn to see what is happening and make logical deductions before you start asking questions.


how to use model? - El Forum - 10-13-2008

[eluser]xwero[/eluser]
Echo is a bad practice to use in functions because it creates output on the spot. if you add a function that uses echo in your controller before you call the view the output of the echo will be above the view.

I really think you should learn the basics of programming before you start developing complex functions.