Welcome Guest, Not a member yet? Register   Sign In
Echo a single entry from a single DB returned array.
#4

[eluser]jmadsen[/eluser]
good job - that's the idea.

In your model, I would add a check first on

Code:
if ($query->numrows() ==1)
{
   return $query->row();  // or ->row_array();
}
return false;

or you can write more generic and return a result(), a row() or false ...how ever you want to expand this (so get person could be for use with a where clause)

Also, I would take the $this->uri->segment(3)) out of the model and pass it in via a parameter instead, that can be validated

Eventually you may want to look into using MY_Model - lots of tutorials out there about that


Messages In This Thread
Echo a single entry from a single DB returned array. - by El Forum - 04-06-2012, 10:52 AM
Echo a single entry from a single DB returned array. - by El Forum - 04-06-2012, 12:44 PM
Echo a single entry from a single DB returned array. - by El Forum - 04-06-2012, 01:45 PM
Echo a single entry from a single DB returned array. - by El Forum - 04-06-2012, 02:42 PM
Echo a single entry from a single DB returned array. - by El Forum - 04-06-2012, 04:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB