Welcome Guest, Not a member yet? Register   Sign In
Load multiple models within same function of controller
#2

Are you sure your getting the price back?

I don't see you doing any debugging to check for a price.


PHP Code:
$query $this->db->query("SELECT price FROM price WHERE item_id='$id'");
$row   $query->row();

if (isset(
$row))
{
 
   $i_price $row;
}
else
{
 
   // ERROR no Price Found!
 
   $i_price 0;
}

return 
$i_price

You should always check to make sure that your getting back the values that you want.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: Load multiple models within same function of controller - by InsiteFX - 04-20-2018, 03:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB