Welcome Guest, Not a member yet? Register   Sign In
How to fix results key from a joined query
#1

[eluser]vps4[/eluser]
Code:
$query = $this->db->query('SELECT a.*, n.node_title FROM article AS a JOIN node AS n ON a.node_ID = n.ID WHERE a.ID = '.(int)$id.' LIMIT 1;');
if ($query->num_rows()) {
    $row = $query->row();
}
print_r($row);

WHY the result be
Code:
Array
(
    [article] => stdClass Object
        (
            [a.ID] => 1
            [a.node_ID] => 1
            [a.title] => the test title
            [a.content] => the test content
            [n.node_title] => category 1
        )
)

how can I fix it to
Code:
Array
(
    [article] => stdClass Object
        (
            [ID] => 1
            [node_ID] => 1
            [title] => the test title
            [content] => the test content
            [node_title] => category 1
        )
)


Messages In This Thread
How to fix results key from a joined query - by El Forum - 05-23-2009, 09:46 AM
How to fix results key from a joined query - by El Forum - 05-24-2009, 01:20 AM
How to fix results key from a joined query - by El Forum - 05-24-2009, 10:11 AM
How to fix results key from a joined query - by El Forum - 05-24-2009, 12:13 PM
How to fix results key from a joined query - by El Forum - 05-24-2009, 12:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB