Welcome Guest, Not a member yet? Register   Sign In
Noob w/ Select issues
#4

[eluser]ggoforth[/eluser]
You also don't need to assign the $query variable to each part of the active record. You technially only have to assign the variable to the ->get() to hold the result. You could rewrite it as:

Code:
$this->db->select(‘code, expires_dt, amount’);
$this->db->from(‘promotions’);
$this->db->where(‘code’, $coupon_code);
$query = $this->db->get();
if ($query->num_rows() > 0)
{
   $row = $query->row();

   echo $row->title;
   echo $row->name;
   echo $row->body;
}


Messages In This Thread
Noob w/ Select issues - by El Forum - 10-11-2009, 01:49 PM
Noob w/ Select issues - by El Forum - 10-11-2009, 02:00 PM
Noob w/ Select issues - by El Forum - 10-11-2009, 03:15 PM
Noob w/ Select issues - by El Forum - 10-11-2009, 05:30 PM
Noob w/ Select issues - by El Forum - 10-12-2009, 08:16 AM
Noob w/ Select issues - by El Forum - 10-12-2009, 08:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB