Welcome Guest, Not a member yet? Register   Sign In
Trouble passing results from the model to the controller
#6

[eluser]Pascal Kriete[/eluser]
Hehe, look a little higher for the usernames Wink .

It's called a ternary operation. Essentially it takes this basic form:
Code:
$value = condition ? if_true : if_false;

Which you could write as:
Code:
if (condition)
    $value = if_true;
else
    $value = if_false;

If you wanted to return $value, you would not assign it to a variable first - and the same concept applies here. So the code I posted translates to this:
Code:
if ($query->num_rows() > 0)
{
    return $query->row();
}
else
{
    return FALSE;
}

Hope that helps.


Messages In This Thread
Trouble passing results from the model to the controller - by El Forum - 10-21-2008, 06:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB