php - no idea why my model returns two different values -


This is my view, all the functions in my postcard model, this gives 4 in one controller and the second return, do not know why, I see what num_rows () is visible to.

In addition to the same, except that, a view is in front of facebook and one view is an admin section

  function view_all () {$ Query = $ this- & gt; Db- & gt; Mill ('Postcard'); Echo $ query- & gt; Num_rows (); $ Data = array (); If ($ query-> num_rows ()> 0) {foreach ($ query-> result_array ($ line as) {$ data [] = $ row;}} $ Query- & gt; FreeCress (); $ data return;}  

Maybe it's a little bit Try changing a bit:

  function view_all () {$ query = $ this-> db- & gt; mill ('postcard'); echo $ query- & gt; num_rows ($); // $ data = array; if ($ query-> num_rows ()> gt; {foreach ($ query- & gt; result_array (as $ line) {$ data [] $$;} $ Return data;} $ query-> Free_result ();}  

Let me know what happens now.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -