Welcome Guest, Not a member yet? Register   Sign In
Active record, adding to the return object
#1

[eluser]Maglok[/eluser]
Lets say I have a database query that returns a result with 7 rows.

Lets say I also have a 2nd database that is unknown to the model. The controller knows the datbase though (it is a forum database).

The object looks kinda like this:
Code:
CI_DB_mysql_result Object
(
    [conn_id] => Resource id #28
    [result_id] => Resource id #80
    [result_array] => Array
        (
        )

    [result_object] => Array
        (
        )

    [custom_result_object] => Array
        (
        )

    [current_row] => 0
    [num_rows] => 7
    [row_data] =>
)

I want to grab an author id and an editor id from each result row, find a name belonging to it from the forum database, and append it to the result object. How would I go about that?

I could grab the name in the view, but that really destroys mvc. Controller is bad enough. Smile




Theme © iAndrew 2016 - Forum software by © MyBB