Welcome Guest, Not a member yet? Register   Sign In
Question about selecting from table
#1

[eluser]Davcon[/eluser]
Hi,

I have a question about basic table selection using the Active Record method.

I understand that the method for a basic table select would be:

Code:
$query = $this->db->get('mytable');

foreach ($query->result() as $row)
{
    echo $row->title;
}

However, there's something about this which bothers me and I can't find an answer.

Suppose $title happens to be empty (i.e., NULL) on a particular row. Now, let's say you wanted to replace that nothingness with a hyphon (after all, empty boxes can ruin table cells). How can you possibly do that in an elegant manner using Active Record?

I guess I could have asked the same thing about stripping slashes, string replacing or doing any kind of manipulation of the data that's being selected.

Thanks for your help.


Messages In This Thread
Question about selecting from table - by El Forum - 03-07-2011, 05:47 PM
Question about selecting from table - by El Forum - 03-07-2011, 11:18 PM
Question about selecting from table - by El Forum - 03-07-2011, 11:25 PM
Question about selecting from table - by El Forum - 03-07-2011, 11:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB