Welcome Guest, Not a member yet? Register   Sign In
Alias, how?
#3

[eluser]meigwilym[/eluser]
Do you mean an alias for table names? This is what I think you need (personally, I like to write out my SQL queries, so I'll do the same here).

Code:
$sql = "SELECT * FROM subcategories AS sc
        INNER JOIN categories AS c
        ON sc.category_id = c.category_id";

$query = $this->db->query($sql);
return $query->row_result();

Bear in mind that this query will return everything, so you may need a WHERE clause too, but that depends on your needs, of course.

Best,

Mei


Messages In This Thread
Alias, how? - by El Forum - 07-16-2008, 07:53 AM
Alias, how? - by El Forum - 07-16-2008, 08:09 AM
Alias, how? - by El Forum - 07-16-2008, 08:11 AM
Alias, how? - by El Forum - 07-16-2008, 10:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB